Invalid credentials when redirected from okta


This is in reference to OAuth2 integration using spring security and okta spring boot starter, where on accessing a rest endpoint, the app is redirected to okta and on successful login there it is redirected back to the app but on the login?error endpoint showing the invalid credentials. No exception or error is seen in the logs for the same but it still fails for this reason.

server.servlet.context-path: /myapp

public class OAuth2LoginSecurityConfig extends WebSecurityConfigurerAdapter {

protected void configure(HttpSecurity http) throws Exception {
            .antMatchers("/login**", "/error**").permitAll()

 * Allows access to static resources, bypassing Spring security.
public void configure(WebSecurity web) throws Exception {
            // Vaadin Flow static resources //

            // the standard favicon URI

            // the robots exclusion standard

            // web application manifest //

            // (development mode) static resources //

            // (development mode) webjars //

            // (production mode) static resources //
            "/frontend-es5/**", "/frontend-es6/**");

Request URL: 
Request Method: GET
Status Code: 302 


Note - Using Vaadin 8, spring boot 2.2.1, okta-spring-boot-starter-1.3.0, spring-security-oauth2-autoconfigure-2.2.1.

have you solved it? me actually having the same issue I am implementing okta oauth2 on spring cloud gateway, everything working fine, while I’m doing a custom-login page with just spring security and spring web