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

oauth2登录无法获取用户信息问题 #2313

Open
awen112 opened this issue Dec 31, 2024 · 13 comments
Open

oauth2登录无法获取用户信息问题 #2313

awen112 opened this issue Dec 31, 2024 · 13 comments

Comments

@awen112
Copy link

awen112 commented Dec 31, 2024

howdoc在配置oauth2登录完成后,进行单点登录无法获取用户信息,该如何配置?
521735617277_ pic
WX20241231-144730@2x

@star7th
Copy link
Owner

star7th commented Dec 31, 2024

那个 获取用户信息的接口 user info path , 你确定这个接口可以返回用户信息吗

@awen112
Copy link
Author

awen112 commented Dec 31, 2024

那个 获取用户信息的接口 user info path , 你确定这个接口可以返回用户信息吗

可以返回

@star7th
Copy link
Owner

star7th commented Dec 31, 2024

返回的数据是怎样的

@star7th
Copy link
Owner

star7th commented Dec 31, 2024

另外这个是最新版showdoc吗,如何安装的

@awen112
Copy link
Author

awen112 commented Dec 31, 2024

返回的数据是怎样的

{
"sub": "x'x'x'x'x",
"email_verified": true,
"phone_number_verified": false,
"preferred_username": "xxxxxxx",
"picture": "xxxxxx",
"updated_at": "xxxxxxxx",
"nickname": "",
"phone_number": "",
"email": "xxxxxxx"
}

@awen112
Copy link
Author

awen112 commented Dec 31, 2024

另外这个是最新版showdoc吗,如何安装的

最新版,一键部署安装的

@star7th
Copy link
Owner

star7th commented Dec 31, 2024

showdoc请求用户信息接口的时候, 其 认证用的access_token 既放到了header中,也放在url的参数中.据我所知, 少部分接口是不能同时用这两种方式.你确认下你的这个用户信息接口, access_token 是放在什么位置的

@star7th
Copy link
Owner

star7th commented Dec 31, 2024

我说的问题,跟这个类似 #2102
接口应该支持两种认证方式的

@awen112
Copy link
Author

awen112 commented Dec 31, 2024

showdoc请求用户信息接口的时候, 其 认证用的access_token 既放到了header中,也放在url的参数中.据我所知, 少部分接口是不能同时用这两种方式.你确认下你的这个用户信息接口, access_token 是放在什么位置的

在url中

@star7th
Copy link
Owner

star7th commented Dec 31, 2024

你上面的报错,意思是接口获取不到任何结果. 获取不到你给出的json数据.
获取不到任何结果的可能性很多, url错了,协议错了,服务器安全限制 等等

@star7th
Copy link
Owner

star7th commented Dec 31, 2024

不应该获取不到任何结果的.假如认证错误,起码应该报个错.我还是觉得你的url写错了.你尝试把host也写上,写完整的url

@leshalv
Copy link

leshalv commented Jan 1, 2025

https://topiam.cn/docs/use-cases/application/showdoc-oidc/ TOPIAM 使用OIDC协议集成的 showdoc,topiam使用的是OIDC协议,返回字段应该是preferred_username。这篇文章建议作者可以加入到文章站中。

@star7th
Copy link
Owner

star7th commented Jan 1, 2025 via email

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