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

集成Oauth认证时参数位置错误 #845

Open
dzy5639313 opened this issue Sep 30, 2024 · 0 comments
Open

集成Oauth认证时参数位置错误 #845

dzy5639313 opened this issue Sep 30, 2024 · 0 comments

Comments

@dzy5639313
Copy link

Describe the bug
使用Knife4j集成认证中心的Authorize认证,到最后使用authorization_code换取token时,参数位置错误,导致换取token失败

To Reproduce
1.正常设置authorization_code默认的openapi配置
2.点击页面上的Authorize,跳转至认证中心认证,回来后网页立即关闭,查看请求header无正确的token

Expected behavior
认证完成后请求header有正确的token

Screenshots
image

image

Knife4j Version (please complete the following information):
使用的knife4j是com.github.xiaoymin:knife4j-openapi3-jakarta-spring-boot-starter:4.4.0版本
Additional context
使用的认证中心是org.springframework.boot:spring-boot-starter-oauth2-authorization-server:3.1.12版本
此版本中的ClientSecretPostAuthenticationConverter的convert方法会使用OAuth2EndpointUtils.getFormParameters获取请求参数,关键地方就是OAuth2EndpointUtils.getFormParameters获取的请求参数会剔除query的参数,导致无法获取正确参数进而导致获取token失败

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

1 participant