CAs for single sign-onEnvironmentClient: www.app1.comCAS server: www.cas-server.com1. Browser: initiating the request www.app1.com2. Client: Authenticationfilter Discovery session is empty, ticket is empty, redirect and save service Https://www.cas-server.com/cas/login?service=http ://www.web.com/app3. CAS server: Show login page, provide Username/password to user authentication by default4. Browser: Input
This article mainly introduces the single-sign-on in PHP session control, has a certain reference value, now share to everyone, the need for friends can refer to
1. Simple use of the next sessionNeed Session_Start () to open session before using sessionWrite a demo to achieve the next
Create a new session.php
Create a new getsession.php and we'll take the value.
Different browsers take different values b
: This article mainly introduces thinkphp second-level domain name site session sharing (single sign-on). If you are interested in PHP tutorials, refer to it. Add the following code to index. php file for each second-level domain name website entry
Define ('domain ', 'cdfanfan. com'); // change cdfanfan.com to the actual root DOMAIN name
// The following two lines are used to share the SESSION of the su
Requirements: The same root domain name or the same domain name of two domain names, to achieve a single sign-on logoutPrinciple:Take B station as an example, B station's account login domain name is passport.bilibili.com. The main station is www.bilibili.com, the game station is www.biligame.com,Get login user Information interface for http://api.bilibili.com/nav?callback=jQuery17209622933453583296_1497257
', ' o000o ', ' oo00o '),Array(' = ', ' + ', '/'),$string), 2);111 $strCount=Count($STRARR); the foreach(Str_split($skey) as $key=$value) {113 $key$strCountisset($STRARR[$key]) $STRARR[$key][1] = = =$value$STRARR[$key] =$STRARR[$key][0]; the } the return Base64_decode(Join(‘‘,$STRARR)); the }117}3. Create the following file in the root directory of the www.b.com1 //slogin.php File completion session settings2PHP3 Session_Start();4 Header(' Content
On the basis of a summary of the use of OAuth2.0 in the framework, the OAuth2.0 logout process of SSO single sign-on was drawn, today we take a look at the process of obtaining yoghurt information based on user token: /** * Obtain user information according to token * @param accesstoken * @return * @throws Exception */@RequestMapping (value = "/user/token /{accesstoken} ", method = requestmethod.get) p
]", "status": "1", "createTime": "2017-06-26" }, "roleIds": "100", "tokenInfo": { "accessToken":"4de55a69-e372-4766-acd3-1c419d6f2fda", "tokenType": "bearer", "webTokent":"uHSLjfJoQwU4t4PAqCzH1SN0fp7PUWKluPNS+x1dZ8R9Gx+NJkBI7w==", "refreshToken":"d3d71594-5c3f-4a68-a7e5-b8d21c4fa73b", "expiresIn": 34644, "scope": "read write" } Note: You can test with the Postman toolFramework Design idea: Provide independent Commonservice-sso microservices, provide com
]", "status": "1", "createTime": "2017-06-26" }, "roleIds": "100", "tokenInfo": { "accessToken":"4de55a69-e372-4766-acd3-1c419d6f2fda", "tokenType": "bearer", "webTokent":"uHSLjfJoQwU4t4PAqCzH1SN0fp7PUWKluPNS+x1dZ8R9Gx+NJkBI7w==", "refreshToken":"d3d71594-5c3f-4a68-a7e5-b8d21c4fa73b", "expiresIn": 34644, "scope": "read write" } Note: You can test with the Postman toolFramework Design idea: Provide independent Commonservice-sso microservices, provide com
]", "status": "1", "createTime": "2017-06-26" }, "roleIds": "100", "tokenInfo": { "accessToken":"4de55a69-e372-4766-acd3-1c419d6f2fda", "tokenType": "bearer", "webTokent":"uHSLjfJoQwU4t4PAqCzH1SN0fp7PUWKluPNS+x1dZ8R9Gx+NJkBI7w==", "refreshToken":"d3d71594-5c3f-4a68-a7e5-b8d21c4fa73b", "expiresIn": 34644, "scope": "read write" } Note: You can test with the Postman toolFramework Design idea: Provide independent Commonservice-sso microservices, provide com
On the basis of a summary of the use of OAuth2.0 in the framework, the OAuth2.0 logout process of SSO single sign-on was drawn, today we take a look at the process of obtaining yoghurt information based on user token: /*** Get user information based on token *@paramAccesstoken *@return * @throwsException*/@RequestMapping (Value= "/user/token/{accesstoken}", method =requestmethod.get) PublicResponsevo Ge
Recently the company is going to make a single sign-on application, integrating forums and websites. To find a lot of information on the Internet, and finally a successful solution, the blog to record one side forget.
Single sign-on first of all to maintain the consistency of database data, this implementation is a lot
Objective
. NET core has been out for a while, the time has also been to do technical preparation, currently want to do a single sign-on (SSO) system, before this use of. NET I used to machinekey, also conveniently in the. NET core to try one, the results found not to make, also does not work, So I began to learn online.
Implementation methods
Kung Fu is not negative, people on the Internet or more, in t
execute the END event within 20 minutes, that is, the user is still online, this user will not be allowed to log on again. This is obviously a bit unreasonable. This solution is not perfect. I hope you can add it.Supplement: the code in step 3 has been updated to solve this problem. 2. For some reason, a single user can only log on to one location in our application, which is also called single-point logon
success page, and then visit APP1 or APP2 need to authenticate again.
The specific configuration is:
Added in the Web.xml files of APP1 and APP2:
The cancellation of the filter is to be before other filter
The logout of the interface connects to the logout address of the CAs, such as Http://localhost:8080/cas/logout
Done
Note: If you visit the logout of CAs directly, there will be a cancellation of the successful page, in fact, most of the time this page is not necessary, more
This Document directory: Overview demo environment Deployment Cas-server related Tomcat deployment Cas-client related Tomcat test verify SSO
First:
This demo is implemented on a machine (three virtual hosts) to see SSO Single Sign-on instance (we can use the same principle on multiple machines), a server host, and two client virtual hosts
Second: In the Tomcat root directory, respectively, the estab
First, Single Sign-On must depend on the client, that is, the client must return the ID to the server. This is the principle.
There are three basic single-point logon solutions.
1. Session
2. Cookies
3. url
Because the client can only save the three basic information
1. Session: The session depends on the sessionid of the client, and the sessionid
Basic System Architecture
Assume that a system includes three independent websites: Service Customer Service Center, shop online shopping center, and office online office center. The Service manages the customer's information, logon and logout processes. No matter whether the customer accesses any page of the system, the system will go to the logon interface. After the user logs on, the system will automatically transfer to the page requested by the customer. In addition, you can seamlessly sw
Basic Architecture
Assume that a system includes three independent websites: Service Customer Service Center, shop online shopping center, and office online office center. The Service manages the customer's information, logon and logout processes. No matter whether the customer accesses any page of the system, the system will go to the logon interface. After the user logs on, the system will automatically transfer to the page requested by the customer. In addition, you can seamlessly switch bet
sso authentication center deregister a global session
@ RequestMapping ("/logout") public String logout (HttpServletRequest req) {HttpSession session = req. getSession (); if (session! = Null) {session. invalidate (); // trigger LogoutListener} return "redirect :/";}
The sso authentication center has a listener for global sessions. once a global session is canceled, all registration systems are notified to log out.
Public class LogoutListener implements HttpSessionListener {@ Override public
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.