Pure PHP based single point of landing

Source: Internet
Author: User

Discuz has a pass, similar to a single point of landing. But I think a single point of landing should preferably be a stand-alone program, as with CAs. Since all the programs are PHP, a simple single sign-on is done. Borrowed the Discuz encryption method.

Users will have direct access to the system in the following ways:

1, the user direct access to Passport, hope to login

2, the user clicks the Landing button from the Passport_app to turn over

3, the user from Passport_app1 to passport_app2 time, passport_app2 turn over the

4, the user directly enter the Access Passport_app URL

2 3 4 Either have referer, or have fromurl parameters

= =

1 applications using the Pass the login button above all points to the link below: http://localhost/passport/login.php

2 If the user has logged in, go to 5

3 If the user has not yet logged in

Go to a landing page to include parameters:

Username, password, fromurl (preprocessed refer)

Submit to Login.php?op=login

4 after verification, set their own session or cookies

5 Get the source address according to the refer inside the user HTTP header.

5.1 If there is no source address, the Passport landing page is displayed, listing all the passport applications

5.2 If there is a refer, then jump back to refer's address, that is, to 6

6 Go to the passport_login.php page of the pass application, passing parameters include:

$userinfo An array that contains user names, roles, groups, and other information, and generally does not need to include a password

$fromurl

$verify MD5 ($auth. $fromurl) To ensure that user information is not tampered with

===============================

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.