我得到OAuth2AuthorizationException:[authorization_request_not_found]。
当试图将授权-授权类型从authorization_code替换为implicit时,会出现以下情况
spring:
security:
oauth2:
client:
registration:
mobile:
provider: auth
client-id: revo
authorization-grant-type: implicit
redirect-uri: "{baseUrl}/login/oauth2/code/{registrationId}"
scope: read
结果将我重定向到loginoauth2codemobile#access_token={++++}&token_type=bearer&state={++++}&expires_in={++++}。
根据源码。authorization_request_not_found
可能是由以下原因引起的
上述情况应保持在 ClientRegistrationRepository
. 在检查了客户端和auth服务器的配置后,第三种可能是服务器和客户端使用了相同的 {baseUrl}
例如,尽管它们在不同的端口,但都是localhost或同一个ip。那么你可以把其中一个改成使用本地配置的域名(例如etchost)。这是因为当客户端和服务器都使用同一个域名时,他们会擦掉另一个在cookie中刚刚设置的session id。