...
Bear in mind that, once Spring Security is enabled in our Spring Boot application, the later has been secured by the self-configuration that Spring Boot does, so we will have to decide which urls we escape (at least the login one), also indicating that we are securing resources through OAUTH2 (We extend from ResourceServerConfigurerAdapter instead of WebSecurityConfigurerAdapter). We will add something of this style to our application:
WARNING: In recent versions, you should delete .anyRequest().authenticated() in order to make the test.
Next, we must program the authentication against the platform with the user/password of the users added to the application's REALM. For this, the onesaitplatform-web-security-client library provides a Spring Bean that allows you to login against the OAUTH2 server. This Bean can be injected by adding our component:
...