Skip to content

No provider found for OAuth2AuthorizationCodeAuthenticationToken when running Spring Native Reactive app using OAuth2 #12615

Closed
@msosa

Description

@msosa

Describe the bug
Logging in using reactive OAuth2 built with native throws after redirect from OAuth2 server(Google in my case).

java.lang.IllegalStateException: No provider found for class org.springframework.security.oauth2.client.authentication.OAuth2AuthorizationCodeAuthenticationToken
        at org.springframework.security.web.server.authentication.AuthenticationWebFilter.lambda$authenticate$6(AuthenticationWebFilter.java:123) 

Do note that the non-reactive counterpart does work and is able to find the provider correctly.

To Reproduce
run gradlew bootBuildImage, run the docker image that is created, and attempt to login via OAuth2.

Expected behavior
Login with reactive Oauth2 without error

Sample

Here is a repo with a working example minus client id/secrets for the oauth2 client

Metadata

Metadata

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions