Skip to content

Commit ab697a0

Browse files
committed
Add oauth2Login()
1 parent 83edd89 commit ab697a0

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/main/java/com/okta/developer/jugtours/config/SecurityConfiguration.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import org.springframework.context.annotation.Profile;
88
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
99
import org.springframework.security.config.annotation.web.builders.WebSecurity;
10-
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
1110
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
1211
import org.springframework.security.web.PortResolver;
1312
import org.springframework.security.web.PortResolverImpl;
@@ -24,7 +23,6 @@
2423
import java.util.*;
2524

2625
@Configuration
27-
@EnableWebSecurity
2826
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
2927
private static final String SAVED_LOGIN_ORIGIN_URI = SecurityConfiguration.class.getName() + "_SAVED_ORIGIN";
3028
private final Logger log = LoggerFactory.getLogger(SecurityConfiguration.class);
@@ -36,7 +34,8 @@ public void configure(WebSecurity web) throws Exception {
3634

3735
@Override
3836
protected void configure(HttpSecurity http) throws Exception {
39-
http
37+
http.oauth2Login()
38+
.and()
4039
.csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())
4140
.and()
4241
.requestCache().requestCache(refererRequestCache())

0 commit comments

Comments
 (0)