Currently, I am using Spring Boot 2.2.5 Release. Documentation looks incomplete. What is the replacement for @EnableOAuth2Client
or @EnableOAuth2Sso
.enter image description here
Asked
Active
Viewed 4,943 times
1

Ralf Wagner
- 1,467
- 11
- 19

Samanta
- 73
- 2
- 4
1 Answers
10
You do it via the WebSecurityConfigurerAdapter's configure method, instead of annotations.
EnableOAuth2Sso is now this:
@Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .anyRequest().authenticated() .and() .oauth2Login(); // sso }
@EnableOAuth2Client is now this (for full examples and config options, see Spring's migration guide):
@Override protected void configure(HttpSecurity http) throws Exception { http .oauth2Client(); }

Marco Behler
- 3,627
- 2
- 17
- 19
-
Since it mentions "Web" in its class name would it be able to security API only resources? no UI. – Andy Dufresne Sep 09 '21 at 09:18