Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opencsg如何设置casdoor为身份验证和授权提供商 #330

Closed
miss-uny opened this issue Jul 19, 2024 · 2 comments
Closed

opencsg如何设置casdoor为身份验证和授权提供商 #330

miss-uny opened this issue Jul 19, 2024 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@miss-uny
Copy link

请问opencsg如何设置casdoor为身份验证和授权提供商
我想达到的目标是 通过casdoor登录后,可以直接转入csghub 。 现在已经实现了设置好了casdoor,可以登录,但无法跳转到csghub。
查询相关的文档也未见相关说明,请提供配置方法,感谢

@hiveer hiveer self-assigned this Jul 19, 2024
@hiveer
Copy link
Collaborator

hiveer commented Jul 19, 2024

我们通过一个环境变量控制登录方式的接入,这个环境变量是: ON_PREMISE

  1. 如果 ON_PREMISE=true 那么系统将采用自带的一个简易登录方式
  2. 如果 ON_PREMISE=false 那么这个时候就可以通过支持 OIDC 的登录方式登录,比如 casdoor

你需要添加如下的环境变量:
OIDC_IDENTIFIER=
OIDC_SECRET=
OIDC_REDIRECT_URI=http:///oidc/callback
OIDC_AUTHORIZATION_ENDPOINT=
OIDC_TOKEN_ENDPOINT=
OIDC_USERINFO_ENDPOINT=

@wayneliu0019
Copy link
Collaborator

这里给你一个配置示例:

假设用户部署的csghub实例的url为http://aihub.mycorp.cn, 启动的casdoor实例url为http://aihub.mycorp.cn:8000,那么portal服务需要更改的配置项目如下:

      ON_PREMISE: false
      OIDC_IDENTIFIER: 57d8874xxxxxxxxxf97
      OIDC_SECRET: 88790798803xxxxxxxxxx5aaa5a5bd8b44d6922d93
      OIDC_REDIRECT_URI: http://aihub.mycorp.cn/oidc/callback
      OIDC_AUTHORIZATION_ENDPOINT: http://aihub.mycorp.cn:8000/login/oauth/authorize
      OIDC_TOKEN_ENDPOINT: http://aihub.mycorp.cn:8000/api/login/oauth/access_token
      OIDC_USERINFO_ENDPOINT: http://aihub.mycorp.cn:8000/api/userinfo
      LOGIN_URL: http://aihub.mycorp.cn:8000/login/oauth/authorize?client_id=57d8874xxxxxxxxxf97&response_type=code&redirect_uri=http://aihub.mycorp.cn/oidc/callback&scope=read&state=casdoor
      SIGNUP_URL: http://aihub.mycorp.cn:8000/signup/portal

上面OIDC_IDENTIFIEROIDC_SECRET分别是在casdoor中创建的appliation对应的client_id和client_secret, 截图如下:
image

@Rader Rader added documentation Improvements or additions to documentation question Further information is requested labels Jul 25, 2024
@OpenCSGs OpenCSGs locked and limited conversation to collaborators Sep 11, 2024
@Rader Rader converted this issue into discussion #597 Sep 11, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants