# 生成KEYSTORE.JKS

keytool -genkeypair -alias keycloak.me -keyalg RSA -keystore keycloak.jks -validity 10950

注意:CN必须是主机名,也可以是ip但是ip容易变,所以主机名或域名。后面访问的是时候通过在hosts 就文件映射域名到IP, 这里将CN 设置为keycloak.me, 注意alias参数不是设置CN的地方

生成好keycloak.jks 之后 复制到 keycloak-7.0.0\standalone\configuration\ 文件夹内

修改STANDALONE.XML 或 STANDALONE-HA.XML 或 DOMAIN.XML

具体修哪个文件,看你的安装方式,此处使用standalone.xml

在 下添加

<security-realm name="ApplicationRealm">
<server-identities>
<ssl>
<keystore path="application.keystore" relative-to="jboss.server.config.dir" keystore-password="password" alias="server" key-password="password" generate-self-signed-certificate-host="localhost" />
</ssl>
</server-identities>
<authentication>
<local default-user="$local" allowed-users="*" skip-group-loading="true" />
<properties path="application-users.properties" relative-to="jboss.server.config.dir" />
</authentication>
<authorization>
<properties path="application-roles.properties" relative-to="jboss.server.config.dir" />
</authorization>
</security-realm>
<!-- 添加的部分 -->
<security-realm name="UndertowRealm">
<server-identities>
<ssl>
<keystore path="keycloak.jks" relative-to="jboss.server.config.dir" keystore-password="openstack" alias="keycloak.me" />
</ssl>
</server-identities>
</security-realm>
<!-- 添加的部分 end -->

然后 搜索 <server name="default-server">

修改为如下内容,

 <server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true" />
<!-- 修改https 的 security realm 为UndertowRealm, 默认为 ApplicationRealm-->
<https-listener name="https" socket-binding="https" security-realm="UndertowRealm" enable-http2="true" />
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content" />
<http-invoker security-realm="ApplicationRealm" />
</host>
</server>

重新启动 standalone.bat

修改HOST文件

添加

127.0.0.1 keycloak.me

访问https://keycloak.me:8443/auth

最新文章

  1. Difference Between HashMap and IdentityHashMap--转
  2. JMeter学习-037-JMeter调试工具之四-BeanShell+jmeter.log
  3. JVM性能调优监控工具jps、jstack、jmap、jhat、jstat、hprof使用详解
  4. [javascript svg fill stroke stroke-width rx ry ellipse 属性讲解] svg fill stroke stroke-width ellipse 绘制椭圆属性讲解
  5. sql2005 全文索引
  6. TP复习14
  7. dpkg的用法
  8. u-boot Makefile整体解析
  9. 背包问题递归java
  10. zoj 1938 Binomial Showdown 组合数裸基础
  11. Excel init
  12. SVN使用指引(Windows)
  13. [LeetCode] Shifting Letters 漂移字母
  14. 想要在launcher中模拟按home键。
  15. R语言-优化作图
  16. pandas.cut使用总结
  17. 1. windows 下redis数据库的安装
  18. 广州区块链系统or积分联盟
  19. Android 数据存储03之SQLite
  20. memory prefix un,under,uni out1

热门文章

  1. form 常用
  2. moment.js相关知识总结
  3. vue基础 &#183; 过滤器(3)
  4. vue项目的两种构建工具Vue CLI和Vite
  5. jq-Grid 能折叠的表格
  6. Cloudflare.com设置域名URL转发
  7. [2010年NOIP普及组] 接水问题
  8. Sentinel 高可用流量管理框架
  9. OutLook从excel导入联系人
  10. 力扣:面试题58 - II. 左旋转字符串