Hi,
I have followed all the steps for Okta integration with Spring boot application as per provided in Okta documentation but still I am getting unable to login unauthorize error during login using Okta credentials. could you please help me out here to this.
Also provided required config properties in application yml file
okta:
oauth2:
client-id: client-id
client-secret: secret
issuer: https://dev-49655571.okta.com/oauth2/default
I am using Java 1.8 along with below spring boot dependencies
implementation group: ‘org.springframework.boot’, name: ‘spring-boot-starter-web’, version: ‘2.6.6’
implementation ‘com.okta.spring:okta-spring-boot-starter:3.0.5’
@EnableWebSecurity
public class SecurityConfig {
@Bean
SecurityFilterChain oauth2SecurityFilterChain(HttpSecurity http) throws Exception {
http.authorizeRequests((requests) → requests.anyRequest().authenticated());
// enables OAuth redirect login
http.oauth2Login();
// enables OAuth Client configuration
http.oauth2Client();
// enables REST API support for JWT bearer tokens
http.oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt);
return http.build();
}
}