Tuesday, August 15, 2023

spring: spring boot: ERR_TOO_MANY_REDIRECTS


>PROBLEM


You try to access the site redirects to the default URL and the browser returns:

ERR_TOO_MANY_REDIRECTS




>SOLUTION

Edit your security class configuration that usually extends extends WebSecurityConfigurerAdapter.
Add the URL that fails.

@Configuration

@EnableWebSecurity

public class SpringSecConfig extends WebSecurityConfigurerAdapter {



@Override

protected void configure(HttpSecurity httpSecurity) throws Exception {

httpSecurity.cors().disable();

httpSecurity.headers().frameOptions().disable();

httpSecurity.csrf().disable()

.authorizeRequests()

.antMatchers("/", "THE MISSING URL HERE").permitAll()


//...

}


>ENV

Java
Spring/Spring Boot

No comments:

Post a Comment

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...