keycloak+gatekeeper(python) 搭建简单流程

1,去官方下载支持python gatekeeper的版本,注意最后一版是12.0.4.下载地址:Keycloak - Downloads 12.0

2,根据需要配置数据库,这个数据库配置在standalone.xml中,参考文件:Server Installation and Configuration Guide

3,配置gatekeeper:参考路径是:Securing Applications and Services Guide

4,安装好后,记住使用在keycloak的安装bin 文件中,找到add-user-keycloak.sh,添加超级用户admin和密码。eg:bin/add-user-keycloak.sh --user admin --password secret

5,关键的是配置keycloak:这个比较麻烦,参考文件:Server Administration Guide其中的文件基本都需要了解一下。简单的配置流程:

  1.         创建realm
    1. 选择endpoints:openid endpoint configuration
    2. login:注意选择reqire ssl: external requests
    3. keys中会默认生成
    4. Themes中,均选择keycloak,internationlization:选择on;supported locales:zh-CN,default local:zh-cn
    5. tokens: 默认的签名是RS256,其他可以不选,保存就好
    6. client Rergistration: 创建一个initial access tokens就好
  2. 创建client
    1. 在clients中创建一个client
    2. 注意client protocol :openid-connect;   access type:confidential
    3. credentials:中选择cient id and secret: 点击regenerate secret,这个在gatekeeper中配置的时候,写在配置文件中
    4. Roles:创建角色
    5. 其他的暂时不选
  3. client scopes:(重点)
    1. Configure audience in Keycloak

    2. Add realm or configure existing
    3. Add client my-app or use existing
    4. Goto to the newly added "Client Scopes" menu [1]
      • Add Client scope 'good-service'
      • Within the settings of the 'good-service' goto Mappers tab
        • Create Protocol Mapper 'my-app-audience'
          • Name: my-app-audience
          • Choose Mapper type: Audience
          • Included Client Audience: my-app
          • Add to access token: on
    5. Configure client my-app in the "Clients" menu
      • Client Scopes tab in my-app settings
      • Add available client scopes "good-service" to assigned default client scopes
  4. identity providers:这个可以根据需要选择一个简单的,参考:Server Administration Guide
  5. users,创建user,选择好需要的角色就好,注意密码设置。其他 不难。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

野狼位位

给点辛苦费0.1元

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值