Single Sign-on authentication process

Source: Internet
Author: User

I. Description of the process

Step One: Access the CAS filter link Ssologin, patchwork directed to cas_server get ticket URL The second step: Cas_server Verify the user information, Build Ticket Step Three: redirect ssologin to the access client and attach the ticket parameter and value fourth step: According to the ticket piece of the link directed to the Cas_server to verify the legality of ticket fifth step: After the Cas_server verification succeeds, Returns an XML message and redirects it to the ssologin of the access client
Parse the XML message and construct the user information object stored in the session
Then jump to the access page after successful login according to the Loginsuccessurl set by Ssologin

Ii. Concrete Steps

1. Load the required jar package

2. Configure the path for single sign-on filtering to/ssologin in Web. xml

Local client Url:http://localhost:8080/saiku/ssologin remote CAS server address Cas_login_url:https://192.168.6.100/ptyhzx-sso/login

3. Process Analysis

(1) Access Ssologin with username and password-requesturl

https://localhost:8080/saiku/ssologin?username=user1&password=123456

(2) Construction of the first visit to Cas_server's Getticketurl

Getticketurl = Cas_login_url? Service parameters

Objective: To obtain ticket

http://cas_server/ptyhzx-sso/login?  Service=http%3a%2f%2flocalhost:8080%2fsaiku%2fssologin&renew=true&other=form&accesstoken= C45BD9AE005909FE2F9EC45D54FF70D2ADD106142B17461AEC94AD4A098A7420025D7694680916B5276CDDE8FA085C5A
Description

Background based on Requesturl construction service parameter Service value = Remove user name password after requesturl parameter + renew parameter + other parameters + user name password encryption after Accesstoken stitching complete after the service overall Code as the final service value

Once the construction gets Getticekturl is finished, redirect to the URL immediately.

(3) Cas_server Verify user information according to Accesstoken

Validation successful

1. Generate token "Example: st-136-tnw7blekurygcdazfgo6-cas01.example.org"

2. Redirect to Requesturl, at which time the Requesturl contains the ticket parameter

Http%3a%2f%2flocalhost:8080%2fsaiku%2fssologin&renew=true&other=form&accesstoken= c45bd9ae005909fe2f9ec45d54ff70d2add106142b17461aec94ad4a098a7420025d7694680916b5276cdde8fa085c5a&ticket= st-136-tnw7blekurygcdazfgo6-cas01.example.org

Validation fails, jumps to the configured Loginfailureurl and prompts for specific error messages

(4) Validurl to the CAS server to verify that the ticket is legitimate according to the obtained ticket construction verification

Validateurl =

Cas_server_url/servicevalidate? + Ticket parameter + servicecode parameter + service parameter

The service parameter is the URL address of the redirect after validation succeeds

http://cas_server/ptyhzx-sso/servicevalidate?ticket=st-136-tnw7blekurygcdazfgo6-cas01.example.org &servercode=101&service=http%3a%2f%2flocalhost%3a8080%2fsaiku%2fssologin%3bjsessionid% 3dd8a37907e4c3bf6d24ccd0568cda7867

(6) Cas_server will return XML message after successful verification

<!--when successful -<Cas:serviceresponseXmlns:cas= ' Http://www.yale.edu/tp/cas '>    <cas:authenticationsuccess>        <Cas:user>A1</Cas:user>        <cas:attributes>                <Cas:id>1100000000000000000</Cas:id>                            <Cas:sex>1</Cas:sex>                            <Cas:username></Cas:username>                            <Cas:authenticationmethod>Com.jeaw.sso.adaptors.jdbc.QueryDatabaseAuthenticationHandler</Cas:authenticationmethod>                            <Cas:email></Cas:email>                            <Cas:nickname>A1</Cas:nickname>                            <Cas:status>1</Cas:status>                            <Cas:cellphone></Cas:cellphone>                            <Cas:usertype>03</Cas:usertype>                            <Cas:loginid>1000000001</Cas:loginid>                            <Cas:password>111111</Cas:password>                    </cas:attributes>    </cas:authenticationsuccess></Cas:serviceresponse><!--when failed -<Cas:serviceresponseXmlns:cas= ' Http://www.yale.edu/tp/cas '>    <cas:authenticationfailureCode= ' Invalid_ticket '>failed to identify the target& #039;st-136-tnw7blekurygcdazfgo6-cas01.example.org& #039;stub</cas:authenticationfailure></Cas:serviceresponse>

(7) Parsing the message constructs the user information object to be stored in the session, jumps to the landing Success page

(8) Interactive process at a glance

Single Sign-on authentication process

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.