Skip to content
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

[Question] 能否提供一个gitlab oidc登录的例子 #1066

Open
1 of 2 tasks
y934317258 opened this issue Jul 8, 2024 · 3 comments
Open
1 of 2 tasks

[Question] 能否提供一个gitlab oidc登录的例子 #1066

y934317258 opened this issue Jul 8, 2024 · 3 comments

Comments

@y934317258
Copy link

y934317258 commented Jul 8, 2024

描述问题
能否提供一个gitlab oidc登录的例子。
目前尝试集成是报了个错,请原因我没有涉足过go开发,无法定位。
目前官方文档里,OIDC模块的内容太少了,UserNameKey、RealNameKey、EmailKey、SessionKey等无法理解是用来做什么的
复现
重现该行为的步骤:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

期望的结果
清晰而简洁地描述你希望得到的结果

截图

部署方式

  • Docker
  • Manual

环境 (请填写环境信息):

  • 操作系统: [e.g. iOS]
  • 浏览器 [e.g. chrome, safari]
  • 版本号 [e.g. 22]

额外的日志信息
[Critical] 2024-07-08 16:34:20 (github.com/cookieY/[email protected]/middleware/recovery.go:33) [PANIC RECOVER] interface conversion: interface {} is nil, not string Traceback:
runtime/iface.go:263
Yearning-go/src/handler/login/oidcLogin.go:96
Yearning-go/src/handler/login/oidcLogin.go:70
github.com/cookieY/[email protected]/context.go:128
github.com/cookieY/[email protected]/middleware/gzip.go:66
github.com/cookieY/[email protected]/context.go:128
github.com/cookieY/[email protected]/middleware/recovery.go:38
github.com/cookieY/[email protected]/context.go:128
github.com/cookieY/[email protected]/middleware/logger.go:58
github.com/cookieY/[email protected]/context.go:128
github.com/cookieY/[email protected]/middleware/cors.go:96
github.com/cookieY/[email protected]/context.go:128
github.com/cookieY/[email protected]/yee.go:206
github.com/cookieY/[email protected]/yee.go:132
net/http/server.go:2939
net/http/server.go:2010
runtime/asm_amd64.s:1651

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: [Question] Can you provide an example of gitlab oidc login?

@potatoone
Copy link

[Oidc]
Enable = true
ClientId = "gitlab提供的id"
ClientSecret = "gitlab提供的密钥"
Scope = "email openid profile"
AuthUrl = "https:///oauth/authorize"
TokenUrl = "https:///oauth/token"
UserUrl = "https:///oauth/userinfo"
RedirectUrL = "http:///oidc/_token-login"
UserNameKey = "preferred_username"
RealNameKey = "name"
EmailKey = "email"
SessionKey = "session_state"

应用程序那里创建一个应用
image
然后把ID和密钥复制到配置文件

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


[Oidc]
Enable = true
ClientId = "id provided by gitlab"
ClientSecret = "Key provided by gitlab"
Scope = "email openid profile"
AuthUrl = "https:///oauth/authorize"
TokenUrl = "https:///oauth/token"
UserUrl = "https:///oauth/userinfo"
RedirectUrL = "http:///oidc/_token-login"
UserNameKey = "preferred_username"
RealNameKey = "name"
EmailKey = "email"
SessionKey = "session_state"

Create an application there
image
Then copy the ID and key to the configuration file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants