Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/netbuffer/oauth-protocol-demo
oauth protocol test,oauth2 server/client endpoint,use sa-token,spring-boot
https://github.com/netbuffer/oauth-protocol-demo
api git hosts javaee javaweb jwt maven oauth oauth2 permission restful sa-token spring spring-boot springframework tomcat
Last synced: 22 days ago
JSON representation
oauth protocol test,oauth2 server/client endpoint,use sa-token,spring-boot
- Host: GitHub
- URL: https://github.com/netbuffer/oauth-protocol-demo
- Owner: netbuffer
- Created: 2021-09-18T07:02:34.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-29T07:30:27.000Z (over 3 years ago)
- Last Synced: 2024-11-06T19:52:39.167Z (2 months ago)
- Topics: api, git, hosts, javaee, javaweb, jwt, maven, oauth, oauth2, permission, restful, sa-token, spring, spring-boot, springframework, tomcat
- Language: Java
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# oauth-protocol-demo
![](https://img.shields.io/static/v1?label=jdk&message=1.8&color=blue)
![](https://img.shields.io/static/v1?label=sppring-boot&message=2.5.4&color=blue)
![](https://img.shields.io/static/v1?label=sa-token&message=1.26.0&color=green)
> 基于 [sa-token](https://sa-token.dev33.cn/) 实现oauth2协议* [oauth2-server](https://sa-token.dev33.cn/doc/index.html#/oauth2/oauth2-server)
* https://github.com/netbuffer/oauth-protocol-demo
* https://gitee.com/netbuffer/oauth-protocol-demo### help
编辑`C:\Windows\System32\drivers\etc\hosts`增加如下配置
```
127.0.0.1 oauth-server.com
127.0.0.1 oauth-client.com
```1. 访问 [/oauth2/authorize](http://oauth-server.com:19000/oauth2/authorize?response_type=code&client_id=10001&redirect_uri=http://sa-token.dev33.cn/&scope=userinfo) 进行登录授权
检测用户在oauth2 server上的登录状态,登录后,再进行oauth2授权流程
2. 访问 [/oauth2/token](http://oauth-server.com:19000/oauth2/token?grant_type=authorization_code&client_id=10001&client_secret=aaaa-bbbb-cccc-dddd-eeee&code={code}) 获取access_token等信息
替换掉其中的code授权码参数