[英]Reactive Spring Security Oauth2 : invalid redirect url
我在 application.yml 文件中配置了一個重定向 url 。 它拋出 404 錯誤
security:
oauth2:
client:
registration:
test:
client-id: xxx
client-secret: xxx
scope: email
authorization-grant-type: authorization_code
redirect-uri: http://localhost:8080/kp/oauth2/redirect
重定向 url 時工作正常
http://localhost:8080/login/oauth2/code/redirect
構造重定向 url 是否有任何模式?
由於您使用的是 spring 的 oauth2 功能,並且 spring 是為您完成 OAuth2 完整流程的人,其中包括重定向 URI,因此您不能提供自己的 URI http://localhost:8080/login/oauth2/code/redirect默認 URI。
僅供參考,您不必首先提及重定向 URI,因為它是默認設置。
另一方面,如果您想手動完成 OAuth2 流程,您可以提供自定義重定向 URI,您只需手動將該重定向 URI 作為您的端點並自己編寫流程。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.