我在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方面有什么模式吗?
发布于 2021-05-22 17:49:58
因为您正在使用spring的oauth2特性,而且spring是为您完成OAuth2完整流(包括重定向URI )的那个特性,所以您不能给自己的URI http://localhost:8080/login/oauth2/code/redirect --这是默认的URI。
FYI您不必首先提到重定向URI,因为它是默认的。
另一方面,如果您想手动完成您所拥有的OAuth2流,可以提供一个自定义重定向URI,您只需手动将该重定向URI作为您的端点,并自己编写该流。
https://stackoverflow.com/questions/67599240
复制相似问题