单点登录流程
2021-11-10 18:59:04 1 举报
单点登录流程,包括单点登录请求token和刷新token
作者其他创作
大纲/内容
第三方后端
单点登录流程-刷新token
是否登录成功
为第三方生成code,将redirectUri封装进响应json
POST/GET/**http://***/**header传参Authentication
GET http://***/indexheader传参Authentication
是
https://ip:port/oauth2/access_token?grantType=authorization_code&appId=***&appSecret=***&code=123
token是否过期
否
enn-auth-core(过滤器)
单点登录入口
业务调用
IDP前端
IDP后端
http://ip:port/login?appId=***&redirectUri=http://***/index
创建TGT,以TGC为key写入客户端cookie
GET登录接口验证cookie(TGC)判断登录状态
生成Authentication做为key缓存accessTokenrefreshToken及用户信息
是否登录
验证appId验证refreshToken是否过期验证TGT会话是否过期刷新accessToken\efreshToken
https://ip:port/oauth2/refresh_token?appId=***&refreshToken=***
前端拦截器获取请求结果json,判定code为超时,从data属性中取出loginUrl值进行重定向跳转
第三方前端
携带refreshToken、appId刷新accessToken
请求token
单点登录流程-请求token
刷新token
(重定向)http://***/index?Authentication=sdfag5g15df
验证grantType\\code验证appId\\appSecret验证code是否过期验证TGT会话是否过期生成accessToken\efreshToken
业务请求
为第三方生成code,直接重定向redirectUri
从header/param/cookie/attribute中获取Authentication做为key从缓存中取accessToken进行登录验证
接收code,携带跟IDP协商好的appId、appSecret,发起access_token请求
响应请求如果是单点登录入口需要重定向跳转到首页,首页缓存Authentication
从header/param/cookie/attribute中获取Authentication做为key缓存accessTokenrefreshToken及用户信息
发起登录请求重定向跳转
是否已登录过
响应请求
重定向登录页面
http://***/index?code=123
是否异步请求
POST登录接口验证appId和redirectUri的合法性;验证用户名密码
用户登录
0 条评论
回复 删除
下一页