Skip to content

Commit 8e25bfd

Browse files
committed
1 parent 3800b04 commit 8e25bfd

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
@@ -8,6 +8,7 @@
88
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
99
import org.springframework.security.config.annotation.web.builders.WebSecurity;
1010
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
11+
import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint;
1112
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
1213
import org.springframework.security.web.csrf.CookieCsrfTokenRepository;
1314
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)