2 Star 2 Fork 0

lijinting01 / oauth2-sso-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

OAuth2 SSO Demo with Spring Boot + Spring Security OAuth2

This demo app consists of following three components:

Authorization Code Flow

image

Resource Owner Password Credentials Flow

Get an Access Token

$ curl -XPOST -u demo:demo localhost:9999/uaa/oauth/token -d grant_type=password -d username=user -d password=password
{"access_token":"00bc1b1a-36be-4884-855b-c7854d7b7915","token_type":"bearer","refresh_token":"06c522b3-66fc-4de1-9a0e-cd1765f8a0a2","expires_in":43199,"scope":"read write"}

Post a Resource

$ curl -H 'Authorization: Bearer 00bc1b1a-36be-4884-855b-c7854d7b7915' \
       -H 'Content-Type: application/json' \
       -d '{"text" : "Hello World!"}' \
       localhost:7777/api/messages
{"text":"Hello World!","username":"user","createdAt":"2016-05-16T12:48:39.466"}

Get Resources

$ curl -H 'Authorization: Bearer 00bc1b1a-36be-4884-855b-c7854d7b7915' localhost:7777/api/messages
[{"text":"Hello World!","username":"user","createdAt":"2016-05-16T12:48:39.466"}]

Variants

空文件

简介

暂无描述 展开 收起
Java
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/lijinting01/oauth2-sso-demo.git
git@gitee.com:lijinting01/oauth2-sso-demo.git
lijinting01
oauth2-sso-demo
oauth2-sso-demo
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891