Redirected you too many times when using SessionCreationPolicy.STATELESS

We are using OKTA and everything was working fine when the microservice was stateful. But then we decided to make our microservice Stateless after which we are getting the error “redirected you too many times” error

application.yml
vocc:
okta:
audience: xxxx
issuer-uri: xxxxx/oauth2/aaa

OKTA SSO

okta:
oauth2:
client-id: XXXXX
client-secret: ssssss
issuer: xxxxx/oauth2/aaaaaaa
groupsClaim: groups

WebSecurityConfigurerAdapter —
@Override
protected void configure(HttpSecurity http) throws Exception {

HttpSecurity voccSecurity = http.csrf().disable();
voccSecurity.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
voccSecurity.authorizeRequests()
.antMatchers("/images/", “/favicon.ico”,"/actuator/health/","/403").permitAll()
// allow antonymous access to the unsecured
.antMatchers("/unsecured/**").permitAll()
// all other requests
.anyRequest().authenticated()
.and().exceptionHandling().accessDeniedHandler(customAccessDeniedHandler)
// set logout URL
.and().logout().logoutSuccessHandler(oidcLogoutSuccessHandler())
// enable OAuth2/OIDC
.and().oauth2Login().defaultSuccessUrl(logoutRedirectUrl, true)
.and().oauth2Client()
.and().oauth2ResourceServer().jwt();

What can be the issue ? Or what is the right way to make the microservice statelesss