当前位置:网站首页>Easy to understand SSO
Easy to understand SSO
2022-07-07 08:12:00 【Extraordinary~】
One 、cookie And session
Before you know it , Let's first understand the following knowledge :「cookie And session」
See this introduction for details
Two 、 Common login authentication mechanism
The process of ordinary login authentication mechanism :
- Users access a system , This system requires login , Then send a login request to the background server ;
- The database judges according to the user name and password sent by the user , Complete login authentication after judging success , Login authentication successful , The server writes the user's login information to session;
- The server generates a cookie, Go back and write to the browser ;
- The next time , When the user accesses the system again , The request will be accompanied by this cookie, The server will follow this cookie Find the corresponding session, adopt session To determine whether this user has logged in .
If there is only one or two systems , This common login authentication mechanism can still meet the needs , however , If in a multi system environment , When operating different systems , You need to log in multiple times , This way becomes very inconvenient , And when clicking login is to solve this situation .
3、 ... and 、 What is? SSO?
Single sign on ( English :Single sign-on, Abbreviation for SSO), Single check in , One for many interrelated , But they are independent software systems , Provide access control properties . When you have this property , When the user logs in , You can get access to all systems , You don't have to log in to every single system .
The short answer is , In a multi system environment , Users only need to log in once , You can log in and access other mutually trusted systems at the same time .
Four 、SSO The advantages of
Benefits of using single sign on :
- Reduce the risk of visiting third-party websites ( User passwords are not stored or externally managed );
- Reduce password fatigue from different combinations of user names and passwords ;
- Reduce the time it takes to re-enter the same identity with the password ;
- Reduce IT Reduce the cost appropriately IT Help desk calls about password ;
- SSO All other applications and systems in the collection , Used for authentication of the authentication server , It is combined with technology to ensure that users do not have to actively enter credentials more than once .
5、 ... and 、 Single sign on in different scenarios
5.1 Sympatric SSO
At this time, both systems are under the same domain name , Differentiate different systems through secondary domain names . For example, there is a domain named :jd.com, At the same time, there are two application systems, namely :a.jd.com and b.jd.com.
As shown in the figure below cookie + redis Single sign on
5.2 Cross domain SSO
Suppose there are three websites , We need to be in the system xiadan And system zhifu Single sign on is realized between the two websites .
xiadan System :www.xiadan.com
zhifu System :www.zhifu.com
SSO System :www.sso.com
SSO The specific process of ( The following steps are consistent with those in the figure )
- The user accesses the system for the first time xiadan,xidan The system needs to log in , But the user is not logged in right now ; Because the user is not logged in , therefore xiadan Server return http Redirect , The redirection of url yes SSO The address of the server , meanwhile url Of query The parameter indicates that after the login is successful , Jump back to xiadan The page of ;
- SSO The server judges that the user is not logged in , Show the user the unified login interface . The user is in SSO Fill in the user name and password on the page of , Log in ;
- SSO After the system is successfully authenticated ,SSO The server creates an authorization token (token), At the same time return to a http Redirect , The browser redirects to the system xiadan:www.xiadan.com. At this point, the redirection of url It's carrying SSO Authorization token generated by the server .
- System xiadan Get the authorization token , towards SSO The server sends the request , Verify whether the token is valid ;
- After successful verification ,xiadan The server knows that the user is already SSO Log on to the , therefore xiadan Server build user login session, Write it down as xiadan session, And will cookie Write to browser ;
- After that, users visit zhifu,zhifu The system is not logged in ; Because the user is not logged in , therefore zhifu Server return http Redirect , The redirection of url yes SSO The address of the server ;
- The browser asks the user in SSO Login status in ,SSO According to the authorization token, the server determines that the user is already SSO Logged in ,SSO The server returns a http Redirect , Carry authorization token , Jump to the system zhifu:www.zhifu.com;
- System zhifu Get the authorization token , towards SSO The server sends the request , Verify whether the token is valid , After successful verification ,zhifu The server knows that the user is already SSO Log on to the , therefore zhifu Server build user login session, Write it down as zhifu session, And will cookie Write to browser .
such ,zhifu The system does not need to enter user name and password for login process , It's login . Then when the user visits xiadan perhaps zhifu after , I'll carry it directly xiadan cookie / zhifu cookie, You don't have to ask SSO Confirmed. .
边栏推荐
- These five fishing artifacts are too hot! Programmer: I know, delete it quickly!
- Rainbond 5.7.1 支持对接多家公有云和集群异常报警
- 船载雷达天线滑环的使用
- 漏洞复现-Fastjson 反序列化
- LeetCode简单题之字符串中最大的 3 位相同数字
- Make LIVELINK's initial pose consistent with that of the mobile capture actor
- Myabtis_Plus
- The charm of SQL optimization! From 30248s to 0.001s
- buureservewp(2)
- Quick analysis of Intranet penetration helps the foreign trade management industry cope with a variety of challenges
猜你喜欢
Dedecms collects content without writing rules
jeeSite 表单页面的Excel 导入功能
让Livelink初始Pose与动捕演员一致
王爽 《汇编语言》之寄存器
一文了解如何源码编译Rainbond基础组件
LeetCode简单题之找到一个数字的 K 美丽值
JSON data flattening pd json_ normalize
[quickstart to Digital IC Validation] 15. Basic syntax for SystemVerilog Learning 2 (operator, type conversion, loop, Task / Function... Including practical exercises)
Avatary的LiveDriver试用体验
Game attack and defense world reverse
随机推荐
柯基数据通过Rainbond完成云原生改造,实现离线持续交付客户
Complex network modeling (III)
【数字IC验证快速入门】17、SystemVerilog学习之基本语法4(随机化Randomization)
2022 Inner Mongolia latest advanced fire facility operator simulation examination question bank and answers
Qinglong panel -- finishing usable scripts
Search for an element in a binary search tree (BST)
Content of string
Qinglong panel - today's headlines
Empire CMS collection Empire template program general
Game attack and defense world reverse
CDC (change data capture technology), a powerful tool for real-time database synchronization
Lattice coloring - matrix fast power optimized shape pressure DP
ZCMU--1396: 队列问题(2)
Niu Mei's mathematical problem --- combinatorial number
Avatary的LiveDriver试用体验
Force buckle 144 Preorder traversal of binary tree
提高企业产品交付效率系列(1)—— 企业应用一键安装和升级
Introduction to basic components of wechat applet
【數字IC驗證快速入門】15、SystemVerilog學習之基本語法2(操作符、類型轉換、循環、Task/Function...內含實踐練習)
Record a stroke skin bone error of the skirt