Hi All,
I am working on to integrate Okta in my Spring MVC project, I searched for Spring projects with Okta but I am finding only Okta with Spring boot project, could you help me with my query to integrate Okta in any spring MVC project?
Hi All,
I am working on to integrate Okta in my Spring MVC project, I searched for Spring projects with Okta but I am finding only Okta with Spring boot project, could you help me with my query to integrate Okta in any spring MVC project?
Hello,
The Okta Spring SDK uses Spring Boot. This SDK relies on Spring Security for most the functionality.
Spring Security has a predefined OAuth provider for Okta, see here.
The following tutorial demonstrates OAuth with Spring Security in both Spring, and Spring Boot.
Hopefully that helps get you started.
Thank You,
Thank you so much! I will take a look and come back with any questions.
I tried following this blog and having the below issue. Any help in this regard is much appreciated!
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http
.csrf().disable()
.authorizeRequests()
.antMatchers(β/β).permitAll()
// all other requests
.anyRequest().authenticated()
// set logout URL
.and().logout().logoutSuccessUrl(β/β)
.addLogoutHandler(new CustomLogoutHandler())
// enable OAuth2/OIDC
.and().oauth2Client()
.and().oauth2Login()
.defaultSuccessUrl(β/loginSuccess.restβ, true);;
return http.build();
}
It kicks in Okta login widget and after login itβs going in a loop and not returning to the client application.