File tree Expand file tree Collapse file tree
src/main/java/com/okta/developer/jugtours/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import org .springframework .context .annotation .Profile ;
88import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
99import org .springframework .security .config .annotation .web .configuration .WebSecurityConfigurerAdapter ;
10+ import org .springframework .security .web .authentication .LoginUrlAuthenticationEntryPoint ;
1011import org .springframework .security .web .authentication .SavedRequestAwareAuthenticationSuccessHandler ;
1112import org .springframework .security .web .csrf .CookieCsrfTokenRepository ;
1213import 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 ()
You can’t perform that action at this time.
0 commit comments