The problem I encountered was solved by myself:
using grant in spring cloud oauth2 project_ The type is password/OAuth/token to access and obtain the token_ error。 In postman, as shown in the figure below:
{
"error": "server_error",
"error_description": "Internal Server Error"
}
Java background error is as follows:
endpoint.TokenEndpoint : Handling error: NestedServletException, Handler dispatch failed; nested exception is java.lang.StackOverflowError
This problem is due to grant_ Type = password represents the user name and password authorization
/**
* This configuration class, which mainly handles the verification of user names and passwords, etc.
*/
@Configuration
public class SecurityConfiger extends WebSecurityConfigurerAdapter {
@Autowired
private PasswordEncoder passwordEncoder;
//register 1 authentication manager object to the container
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
/**
* Password encoding object (passwords are not encrypted)
*/
@Bean
public PasswordEncoder passwordEncoder() {
return NoOpPasswordEncoder.getInstance();
}
/**
* Handle username and password authentication
* 1) The client passes username and password parameters to the authentication server
* 2) Generally, username and password are stored in the database in the user table
* 3) Verify the legitimacy of the currently passed user information based on the data in the user table
*/
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
super.configure(auth);
// In this method you can go to the associated database, currently we first configure the user information in memory
// instantiate 1 user object (equivalent to 1 user record in the data table)
UserDetails user = new User("admin","123456",new ArrayList<>());
auth.inMemoryAuthentication()
.withUser(user).passwordEncoder(passwordEncoder);
}
}
Problem solving: the following are purely personal views:
Read More:
- Error creating bean with name ‘org.springframework.security.oauth2.config.annotation.web.configurati
- After SAP Spartacus successfully logs in, does the request base site need access token
- remote: XXX Incorrect username or password (access token) fatal: Authentication failed for XXX
- About writing [if] and [else] statements in JSP, Syntax error on token “else”, delete this token
- 107_ Error report and solution of erc20 token transfer
- Local can link to the server database, upload jar package to the server will report an error
- Git report HTTP Basic: Access denied
- Passwd: authentication token manipulation error in Linux
- Notes on @ pathvariable annotation in springcloud openfeign
- Authentication token manipulation error appears in ubuntu18.04 password modification
- Ganglia cannot access: you don’t have permission to access / ganglia on this server
- Token bucket implementation with adaptive token generation rate
- scalac: Token not found: C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2020.3\compile-server\to
- Syntax error on token “}“, delete this token
- When generating a test report in HTML format, report [typeerror: a bytes like object is required, not ‘STR’]
- Syntax error on token “eat”, identifier expected after this token
- Error resolution of unexpected token in JSON at position 0
- Distribution setup SQL Server Agent error: “RegCreateKeyEx() returned error 5, ‘Access is denied.’” …
- Navicat remote connection SQL Server 2014 express report 08001 error
- Unexpected token o in JSON at p