Skip to content

Latest commit

 

History

History

lion-auth

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

lion-auth(8888)

本服务采用了 mysql 存储 clientId 验证信息,需创建 oauth_client_details 表,请参考 OAuth2 Schema DDL

本地部署

SERVER_PORT=8888 \
REGISTER_HOST=localhost \
java -jar lion-auth-x.x.x.jar

容器部署

docker pull micyo202/lion-auth:tagname
docker run -d \
        -p 8888:8888 \
        -e REGISTER_HOST=localhost \
        micyo202/lion-auth:tagname

授权码模式,获取access_token请求(/oauth/authorize)

请求所需参数:client_id、response_type、redirect_uri

http://localhost:8888/oauth/authorize?client_id=lion-client&response_type=code&redirect_uri=https://github.com/micyo202/lion

授权码模式,获取access_token请求(/oauth/token)

请求所需参数:client_id、client_secret、scope、grant_type、redirect_uri、code

http://localhost:8888/oauth/token?client_id=lion-client&client_secret=secret&scope=all&grant_type=authorization_code&redirect_uri=https://github.com/micyo202/lion&code=YBElD2

用户/密码模式,获取access_token请求(/oauth/token)

请求所需参数:client_id、client_secret、scope、grant_type、username、password

http://localhost:8888/oauth/token?client_id=lion-client&client_secret=secret&scope=all&grant_type=password&username=admin&password=123456

检查token是否有效请求(/oauth/check_token)

请求所需参数:token

http://localhost:8888/oauth/check_token?token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

刷新token请求(/oauth/token)

请求所需参数:grant_type、refresh_token、client_id、client_secret

http://localhost:8888/oauth/token?grant_type=refresh_token&refresh_token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&client_id=lion-client&client_secret=secret

获取凭证信息

http://localhost:8888/principal?access_token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

销毁凭证信息

http://localhost:8888/revoke?access_token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx