I'am trying to setup Spring OAuth2 and using a custom WebSecurityConfigurerAdapter (@EnableWebSecurity).
As a base I copied the following two projects:
- vanilla-sample
- a client application with @EnableOAuth2Sso and the corresponding properties
This works as expected out-of-the-box.
But, when I try to add a WebSecurityConfigurerAdapter with @EnableWebSecurity to the Auto-Server (vanilla), it fails.
I'm getting a Authentication Failed: Could not obtain access token when redirect back after login and authorization at the login page of the client.
I have setup a security.oauth2.resource.userInfoUri which worked just fine without the WebSecurityConfigurerAdapter.
Any ideas how to configure oauth2 with a WebSecurityConfigurerAdapter?