首页 新闻 会员 周边

GitLab SSO 登录问题:"Signing in using your Cnblogs account without a pre-existing GitLab account is not allowed"

0
悬赏园豆:30 [已解决问题] 解决于 2022-11-23 19:46

参考 Generic OAuth 2.0 provider 将 IdentityServer4 配置为 GitLab 的 OAuth 2.0 Provider,将 GitLab 已有账号关联到 IdentityServer4 所使用的账号可以正常登录,但无法自动创建账号,如果以没有关联的账号登录,GitLab 登录页面会出现错误提示:

Signing in using your Cnblogs account without a pre-existing GitLab account is not allowed

请问如何解决?

dudu的主页 dudu | 高人七级 | 园豆:30994
提问于:2022-11-23 17:24
< >
分享
最佳答案
0

在 /etc/gitlab/gitlab.rb 中添加下面的配置解决了

gitlab_rails['omniauth_allow_single_sign_on'] = "oauth2_generic"

oauth2_generic 就是 omniauth_providers 配置中的 name

gitlab_rails['omniauth_providers'] = [
  {
    name: "oauth2_generic",
    label: "Cnblogs",
    # ....
  }
]
dudu | 高人七级 |园豆:30994 | 2022-11-23 19:46
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册