Tag Archives: spring security

NestedServletException, Handler dispatch failed; nested exception is java.lang.StackOverflowError [Solved]

After setting up the spring security oauth2 environment, conduct interface test with postman:

Postman returned an error message:

The idea console outputs the following warnings:

WARN 4344 — [nio-8082-exec-1] o.s.s.o.provider.endpoint.TokenEndpoint  : Handling error: NestedServletException, Handler dispatch failed; nested exception is java.lang.StackOverflowError

After investigation, it is found that a method in the spring security configuration class securityconfiguration written by myself is wrong and written as: AuthenticationManager. The correct method name should be authenticationmanagerbean.

The complete and correct method is:

@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
      return super.authenticationManagerBean();
}

Retest after modification and return the correct result:

If you encounter any problems during browsing, please leave me a message in the comment area below.

spring security There was an unexpected error (type=Forbidden, status=403).

 

The reason is that the defined role names do not match
Path permission rule matching configuration is :ADMIN here program can not configure ROLE_ role or directly report the BUG
The user’s permissions are configured in custom permission validation :ROLE_ADMIN needs to be preceded by ROLE_
This pit stepped on twice This design is very wanted to make fun of