Skip to content

Commit 29e3e1a

Browse files
committed
Merge branch 'spring-security-5.1' of github.com:oktadeveloper/okta-spring-boot-react-crud-example into spring-security-5.1
2 parents 43b91a7 + 22aae51 commit 29e3e1a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
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.configuration.WebSecurityConfigurerAdapter;
10+
import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint;
1011
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
1112
import org.springframework.security.web.csrf.CookieCsrfTokenRepository;
1213
import org.springframework.security.web.savedrequest.RequestCache;
@@ -31,6 +32,9 @@ protected void configure(HttpSecurity http) throws Exception {
3132
SavedRequestAwareAuthenticationSuccessHandler handler = new SavedRequestAwareAuthenticationSuccessHandler();
3233
handler.setRequestCache(requestCache);
3334
http
35+
.exceptionHandling()
36+
.authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/oauth2/authorization/okta"))
37+
.and()
3438
.oauth2Login()
3539
.successHandler(handler)
3640
.and()

0 commit comments

Comments
 (0)