We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
通过code 访问 localhost:9090/oauth/authorize?client_id=client_3&response_type=code&scope=select&redirect_uri=http://localhost:9090/client/redirect&code=x88wib 采用POST请求 返回 { "timestamp": 1531993410032, "status": 401, "error": "Unauthorized", "message": "Full authentication is required to access this resource", "path": "/oauth/authorize" }
代码是最简单的代码,按照博客操作的 还请做着给予解答疑惑
代码如下: @configuration public class OAuth2Config { @configuration @EnableAuthorizationServer//是的,没做,就这么一个注解 public class AuthorizationServerConfig { }
@Configuration @EnableResourceServer//咦,没错还是一个注解 public class ResourceServerConfig { }
}
@component public class MyUserDetailsService implements UserDetailsService { @OverRide public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { return new User(username, "123456", AuthorityUtils.commaSeparatedStringToAuthorityList("ROLE_USER")); } }
@RestController @slf4j public class AuthDemoEndpoint {
@RequestMapping("/redirect") public String redirect(String code){ log.info("oauth 2 code is :{}",code); return code; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
http://localhost:9090/oauth/authorize?response_type=code&client_id=client_3&redirect_uri=http://localhost:9090/redirect&scope=select
重定向到http://localhost:9090/redirect?code=x88wib
且页面返回如下信息
通过code 访问
localhost:9090/oauth/authorize?client_id=client_3&response_type=code&scope=select&redirect_uri=http://localhost:9090/client/redirect&code=x88wib
采用POST请求
返回
{
"timestamp": 1531993410032,
"status": 401,
"error": "Unauthorized",
"message": "Full authentication is required to access this resource",
"path": "/oauth/authorize"
}
代码是最简单的代码,按照博客操作的
还请做着给予解答疑惑
代码如下:
@configuration
public class OAuth2Config {
@configuration
@EnableAuthorizationServer//是的,没做,就这么一个注解
public class AuthorizationServerConfig {
}
}
@component
public class MyUserDetailsService implements UserDetailsService {
@OverRide
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
return new User(username, "123456", AuthorityUtils.commaSeparatedStringToAuthorityList("ROLE_USER"));
}
}
@RestController
@slf4j
public class AuthDemoEndpoint {
}
The text was updated successfully, but these errors were encountered: