oauth授权
- spring-security-oauth(GitHub 项目源码)
- 参考文档
- oauth2-demo
- springcloud-oauth
- 系列文章 - 从零开始的Spring Security Oauth2
- spring-security-oauth2-example 数据库版
- Auth-service Redis版
- microservice-integration 网关整合版
1. 授权码模式使用
访问授权链接,获取授权码
http://localhost:9401/oauth/authorize?response_type=code&client_id=admin&redirect_uri=http://www.baidu.com&scope=all&state=normal
获取access_token
http://localhost:9401/oauth/token?grant_type=authorization_code&code=Q5XV3N&client_id=admin&scope=all&redirect_uri=http://www.baidu.com
通过access_token访问资源
2. 客户端模式授权
访问链接直接获取access_token
http://localhost:9401/oauth/token?grant_type=client_credentials&client_id=admin&client_secret=admin123456
通过access_token访问资源同上
3. 用户名密码授权模式
访问链接直接获取access_token
http://localhost:9401/oauth/token?grant_type=password&username=mark&password=123456
通过access_token访问资源同上