sample-spring-oauth2-microservices icon indicating copy to clipboard operation
sample-spring-oauth2-microservices copied to clipboard

Using WebSecurityConfigurerAdapter breaks the app services

Open BenDol opened this issue 5 years ago • 0 comments

When attempting to migrate this sample to my own environment I've run into an issue where as soon as I include a WebSecurityConfigurerAdapter in the app, the test no longer works and I receive a 401 error. This is because the app no longer authenticates strictly from the OAuth2AuthenticationManager it seems to skip this entirely for what ever reason.

Would you be able to help me understand how I can resolve this issue? Obviously the filter or process is being short circuited, but I haven't had any luck figuring out why.

How to reproduce: Add the following anywhere in one of the apps (account/customer):

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {


}

Then start the services and attempt to run the test.

I need to be able to authenticate my application both using EnableOAuth2Client or EnableOAuth2Sso as well as the way you are utilizing it. Perhaps someone could sample how this would work next?

Any help is much appreciated, thanks!

BenDol avatar Sep 11 '18 10:09 BenDol