请问Kubesphere3.0正式版如何使用第三方oauth2登录?
hongmingK零SK壹S
tjushilei 可以看看这个PR, 也是社区用户参与贡献的 https://github.com/kubesphere/kubesphere/pull/2997
hongmingK零SK壹S
tjushilei
需要在拓展插件的时候开启。https://github.com/kubesphere/kubesphere/pull/2997/files#diff-b423b5e9705b01b7a403ecac0045b6c717e3f6235c9551c47230fd43a96b2e40R96
idaas这个feature 最近才合并,可以用 kubespheredev/ks-apiserver:latest
这个镜像
hongmingK零SK壹S
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
hongmingK零SK壹S
- 已编辑
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
hongmingK零SK壹S
tjushilei pod 都正常运行吗,有没有什么明显的错误日志,可以把配置贴出来看看
kubectl -n kubesphere-system get deploy ks-console -ojsonpath='{.spec.template.spec.containers[0].image}'
kubectl -n kubesphere-system get deploy ks-apiserver -ojsonpath='{.spec.template.spec.containers[0].image}'
kubectl -n kubesphere-system get cm kubesphere-config -ojsonpath='{.data.kubesphere\.yaml}'