简体   繁体   English

“没有足够的权限访问本机 PKCE 协议”

[英]"Not enough permissions to access Native PKCE protocol"

I am developing a web application using Spring framework and Java.我正在使用 Spring 框架和 Java 开发一个 Web 应用程序。 I have added a login with linkedin feature to my webapp(domain:localhost);我在我的 webapp(domain:localhost) 中添加了一个带有linkedin 功能的登录名; however, i am getting a 403 Forbidden error "Not enough permissions to access Native PKCE protocol" (i am able to redirect to linkedin + allow a consent screen).但是,我收到 403 Forbidden 错误“没有足够的权限访问本机 PKCE 协议”(我能够重定向到linkedin + 允许同意屏幕)。 i get the error when redirecting to my webapp login page.重定向到我的 webapp 登录页面时出现错误。

    application.properties
spring.security.oauth2.client.registration.linkedin.clientId=
spring.security.oauth2.client.registration.linkedin.secret=
spring.security.oauth2.client.registration.linkedin.client-authentication-method=post
spring.security.oauth2.client.registration.linkedin.authorization-grant-type=authorization_code
spring.security.oauth2.client.registration.linkedin.scope=r_liteprofile
spring.security.oauth2.client.registration.linkedin.redirect-uri=http://localhost:8080/login/oauth2/code/linkedin
spring.security.oauth2.client.registration.linkedin.client-name=Linkedin
spring.security.oauth2.client.registration.linkedin.provider=linkedin
spring.security.oauth2.client.provider.linkedin.authorization-uri=https://www.linkedin.com/oauth/v2/authorization
spring.security.oauth2.client.provider.linkedin.token-uri=https://www.linkedin.com/oauth/v2/accessToken
spring.security.oauth2.client.provider.linkedin.user-info-uri=https://api.linkedin.com/v2/me
spring.security.oauth2.client.provider.linkedin.user-name-attribute=id

enter image description here在此处输入图片说明

webSecurityConfig http.oauth2login() webSecurityConfig http.oauth2login()

As per the Microsoft doc https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow-native you need to contact the LinkedIn team to enable the PKCE workflow.根据 Microsoft 文档https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow-native,您需要联系 LinkedIn 团队以启用 PKCE 工作流程。 If you have already done that then Authorization API you need to call is https://www.linkedin.com/oauth/native-pkce/authorization .如果您已经这样做了,那么您需要调用的授权 API 是https://www.linkedin.com/oauth/native-pkce/authorization And if you have stumbled upon PKCE and not intended to use it then just disable the same in Spring configuration.如果您偶然发现了 PKCE 并且不打算使用它,那么只需在 Spring 配置中禁用它即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM