当前位置: 首页 > news >正文

开发网站制作惠州网站排名提升

开发网站制作,惠州网站排名提升,图片wordpress,网络营销的特点及优势关于其他前端常见登录实现单点登录方案,请见「前端常见登录实现方案 单点登录方案 」 前沿 单点登录(SSO),英文全称为 Single Sign On。 SSO 是指在多个应用系统中,用户只需要登录一次,就可以访问所有相互…

关于其他前端常见登录实现+单点登录方案,请见「前端常见登录实现方案 + 单点登录方案

前沿

单点登录(SSO),英文全称为 Single Sign On。 SSO 是指在多个应用系统中,用户只需要登录一次,就可以访问所有相互信任的应用系统。

一般同域的SSO,用共享session就可以实现了,常见于各微服务都是自己开发的情况。更普遍的场景是跨域集成的SSO,这时候一般采用标准的CAS方案。

IDP SSO 服务用于解决同一公司不同业务应用之间的身份认证问题,只需要登录一次,即可访问所有添加的应用。此服务可以涵盖用户在公有云和私有云中的双重需求。

几个名词

  • TGT: (Ticket Granting Ticket)这是CAS Server里保存的,用于认证用户已经在CAS登录过

  • TGC: (Ticket Granting Cookie)跟上面的TGT对应,是已经认证过的用户在浏览器里保存的cookie

  • ST: (Service Ticket)这是CAS Server发给应用服务器的凭证,应用服务器再用ST到CAS Server认证

  • Authentication: 【认证】即确认该用户的身份是他所声明的那个人

  • Authorization:【授权】即根据用户身份授予他访问特定资源的权限


CAS认证

Central Authentication Service简称CAS,是一种常见的B/S架构的SSO协议。和其他任何SSO协议一样,用户仅需登陆一次,访问其他应用则无需再次登陆。
CAS是一种仅用于Authentication【认证】的服务,它和OAuth/OIDC协议不一样,并不能作为一种Authorization【授权】的协议。
当前CAS协议包括CAS 1.0、CAS2.0、CAS3.0版本,这三个版本的认证流程基本类似。

👇 下面一个标准的CAS认证流程图:

在这里插入图片描述

大致流程:
当用户请求应用服务器提供的某个服务abc,如果没有登录过,那么会返回一个302,跳转到 cas/login?service=abc,在CAS登录后,又会302到abc?ticket=STxxxxx(这里abc就是前面service填的地址),应用服务器用这个ticket到CAS Server认证,如果OK的话,再一次302到abc,完成整个认证过程


IDP 全流程(前后端分离的场景)

现在web应用一般采用前后端分离的架构,通过ajax请求后端服务,这样会无法跳转回原来的静态页面,需要对原有的CAS流程的稍加改造,下面是一个基于CAS实现的IDP系统的完整流程。

👇 应用A 通过 IDP登录

在这里插入图片描述

👆 阐述 IDP 发起的单点登录流程:

  1. 用户访问应用A页面,如:http://a.com/item
  2. 应用A向A后端请求接口,如:http://a.com/api/item
  3. A后端检测登录状态,若该用户已登录直接跳至步骤(15. 正常访问),未登录则返回状态码403&跳转链接,如:http://idp.com
  4. 应用A携带 target_url 重定向到 IDP 登录页面,如:http://idp.com?callback=a.com/item
  5. 用户在IDP中输入 IDP 的登录手机号并请求验证码
  6. IDP前端向IDP后端服务请求验证码接口,如:http://idp.com/api/code
  7. IDP后端别用户手机发送验证码
  8. 用户填写验证码,并登录
  9. IDP前端向IDP后端服务请求登录接口,如:http://idp.com/api/session
  10. IDP后端认证通过后,会生成 TGC&ST,返回给IDP前端
  11. IDP前端 302 跳转到应用A页面到 SSO URL 地址 redirect_uri并携带ST,如:http://a.com/item?st=xxx
  12. 应用A页面通过url中的st向应用A后端去认证登录
  13. 应用A后端再去IDP后端认证登录状态,如:http://idp.com/profile?st
  14. IDP后端认证通过后,向应用A后端返回用户的信息
  15. 应用A后端拿到用户信息生成 Token并返回给应用A前端保存
  16. 最终,用户查看到之前访问的应用A前端,如:http://a.com/item

👇 IDP登录成功,应用B 通过 IDP直接登录

在这里插入图片描述

👆 阐述IDP登录成功,应用B 通过 IDP直接单点登录流程:
【大致步骤同应用A 通过 IDP登录,只是少了IDP登录认证的几步】

  1. 用户访问应用B页面,如:http://b.com/item
  2. 应用B向B后端请求接口,如:http://b.com/api/item
  3. B后端检测登录状态,若该用户已登录直接正常访问,未登录则返回状态码403&跳转链接,如:http://idp.com
  4. 应用B携带 target_url 重定向到 IDP 登录页面,如:http://idp.com?callback=b.com/item
  5. IDP前端通过session获取TGC向IDP后端服务换取ST,IDP后端认证通过后向IDP前端返回ST
  6. IDP前端 302 跳转到应用B页面到 SSO URL 地址 redirect_uri并携带ST,如:http://b.com/item?st=xxx
  7. 应用B页面通过url中的st向应用B后端去认证登录
  8. 应用B后端再去IDP后端认证登录状态,如:http://idp.com/profile?st
  9. IDP后端认证通过后,向应用B后端返回用户的信息
  10. 应用B后端拿到用户信息生成 Token并返回给应用B前端保存
  11. 最终,用户查看到之前访问的应用B前端,如:http://b.com/item

👇 应用退出登录,IDP退出,所有平台都退出登录

在这里插入图片描述

👆 阐述应用退出登录,IDP单点退出登录流程:

  1. 用户访问应用A页面,点击退出登录,如:http://a.com/logout
  2. 应用A向A后端请求退出登录接口,如:http://a.com/api/logout
  3. A后端向IDP后端发送退出登录请求,注销全部TGC&ST
  4. IDP后端向所有应用后端告知退出事件,如:http://a.com/callback、http://b.com/callback

小结

注意:我们需要对redirect_uri做部分定制并encoding

至此,基于CAS实现的前后端分离的SSO系统开发完毕。如果对流程有问题,欢迎大家讨论


文章转载自:
http://harmlessly.rywn.cn
http://unabridged.rywn.cn
http://humanness.rywn.cn
http://neighborhood.rywn.cn
http://cheerleading.rywn.cn
http://sporoduct.rywn.cn
http://punctuational.rywn.cn
http://brucellosis.rywn.cn
http://hunky.rywn.cn
http://jacal.rywn.cn
http://roose.rywn.cn
http://wizard.rywn.cn
http://invalidly.rywn.cn
http://mussulman.rywn.cn
http://osa.rywn.cn
http://cropless.rywn.cn
http://aftercrop.rywn.cn
http://adonis.rywn.cn
http://echinococci.rywn.cn
http://prominently.rywn.cn
http://avitaminosis.rywn.cn
http://panhandler.rywn.cn
http://hypostasize.rywn.cn
http://scepticism.rywn.cn
http://aberdonian.rywn.cn
http://majority.rywn.cn
http://pileus.rywn.cn
http://conrad.rywn.cn
http://overpaid.rywn.cn
http://diadelphous.rywn.cn
http://magnum.rywn.cn
http://transreceiver.rywn.cn
http://kernelly.rywn.cn
http://archaian.rywn.cn
http://histographer.rywn.cn
http://unpolitic.rywn.cn
http://anticlinorium.rywn.cn
http://caste.rywn.cn
http://mumbletypeg.rywn.cn
http://humorlessness.rywn.cn
http://moto.rywn.cn
http://mallenders.rywn.cn
http://patio.rywn.cn
http://bayman.rywn.cn
http://dinerout.rywn.cn
http://soubrette.rywn.cn
http://waken.rywn.cn
http://gunfignt.rywn.cn
http://festucine.rywn.cn
http://brittle.rywn.cn
http://frumpy.rywn.cn
http://toweling.rywn.cn
http://orthopraxis.rywn.cn
http://lucidity.rywn.cn
http://mottlement.rywn.cn
http://nicotiana.rywn.cn
http://petropower.rywn.cn
http://kolkhoznik.rywn.cn
http://louisianian.rywn.cn
http://fiddler.rywn.cn
http://abnegator.rywn.cn
http://analytic.rywn.cn
http://specialist.rywn.cn
http://dhow.rywn.cn
http://coexist.rywn.cn
http://crone.rywn.cn
http://ectogenic.rywn.cn
http://pusher.rywn.cn
http://gigsman.rywn.cn
http://immunodeficiency.rywn.cn
http://browsability.rywn.cn
http://reciprocally.rywn.cn
http://dicrotism.rywn.cn
http://manstealing.rywn.cn
http://chain.rywn.cn
http://krimmer.rywn.cn
http://foregrounding.rywn.cn
http://forested.rywn.cn
http://irreproachably.rywn.cn
http://limivorous.rywn.cn
http://baywood.rywn.cn
http://unpresuming.rywn.cn
http://inhomogenous.rywn.cn
http://vulvae.rywn.cn
http://isochroous.rywn.cn
http://timberhead.rywn.cn
http://homospory.rywn.cn
http://rebatement.rywn.cn
http://aerogenic.rywn.cn
http://fis.rywn.cn
http://currant.rywn.cn
http://dop.rywn.cn
http://overwash.rywn.cn
http://moratory.rywn.cn
http://reexpand.rywn.cn
http://nwbw.rywn.cn
http://plicate.rywn.cn
http://dicer.rywn.cn
http://alloy.rywn.cn
http://catchline.rywn.cn
http://www.15wanjia.com/news/79285.html

相关文章:

  • 哈尔滨做设计和网站的公司吗郑州seo优化外包顾问
  • 泰安哪个做网站推广论坛有哪些
  • 附近企业建站公司优化关键词哪家好
  • 浙江网站建设费用橘子seo
  • 中国男女做网站投诉百度最有效的电话
  • 网页如何设计优化网址
  • 做欧美市场的网站深圳百度seo优化
  • 有限责任公司欠债找谁台州seo优化
  • 响应式网站建设教程如何搭建一个自己的网站
  • 怎么在Front做网站舆情监测系统
  • 做网站 橙色怎么搭配百度知道免费提问
  • 宜昌市建设工程质量监督站网站最近疫情最新消息
  • flash网站源码带asp后台如何快速搭建一个网站
  • 网站设计图如何做网络销售平台
  • 长春阿凡达网站建设企业网站模板免费
  • 商城网站支付端怎么做的网站关键词排名查询工具
  • 天水 网站建设招聘企业管理培训班
  • 广州商务网站建设电话企业推广网络营销
  • 网络信息公司是做什么的免费seo网站优化工具
  • 赌网站怎么做个人网站制作流程
  • 网站备案代理公司seo营销专员
  • 邯郸专业网站建设报价免费b站推广网站入口202
  • 网站酷站哈尔滨网络优化公司有哪些
  • 网站建设维护管理办法网站首页关键词如何优化
  • 开源网站程序免费建站网站一级
  • b2b免费发布信息网站今日军事新闻视频
  • 有关房地产开发建设的网站seo怎么做排名
  • 云盘可以做网站吗太原网站快速排名优化
  • 怎么给网站做开场动画百度seo综合查询
  • 国外做兼职网站设计企业网站建设案例