tjushileiK零S
公司需要从公司的portal单点登录到kubesphere,使用oauth2协议,但网上资料太少,还请大佬能解答一下~
公司需要从公司的portal单点登录到kubesphere,使用oauth2协议,但网上资料太少,还请大佬能解答一下~
tjushilei 可以看看这个PR, 也是社区用户参与贡献的 https://github.com/kubesphere/kubesphere/pull/2997
tjushilei
需要在拓展插件的时候开启。https://github.com/kubesphere/kubesphere/pull/2997/files#diff-b423b5e9705b01b7a403ecac0045b6c717e3f6235c9551c47230fd43a96b2e40R96
idaas这个feature 最近才合并,可以用 kubespheredev/ks-apiserver:latest
这个镜像
tjushilei 这个就是示例配置
identityProviders:
- name: aliyunidaas
type: AliyunIDaasProvider
mappingMethod: mixed
provider:
clientID: xxxx
clientSecret: xxxx
endpoint:
userInfoUrl: "https://xxxxx.login.aliyunidaas.com/api/bff/v1.2/oauth2/userinfo"
authURL: "https://xxxx.login.aliyunidaas.com/oauth/authorize"
tokenURL: "https://xxxx.login.aliyunidaas.com/oauth/token"
redirectURL: "http://ks-console/oauth/redirect"
scopes:
- read
需要用kubespheredev/ks-apiserver:latest
这个镜像或者自己build
tjushilei 要用 latest
这个tag 这个是master分支最新的代码, 注意是kubespheredev/ks-apiserver:latest
不是 kubesphere/ks-apiserver:latest
插件开发也非常简单,只用适配账户关联部分的逻辑,https://github.com/kubesphere/kubesphere/blob/master/pkg/apiserver/authentication/oauth/oauth_options.go#L37-L44