How to implement SSO across primary domains _ PHP Tutorial

Source: Internet
Author: User
The idea of implementing SSO across the primary domain. The idea of implementing SSO across primary domains is that the same primary domain (that is, all subdomains under the same level-1 domain name) includes multiple server sharing SESSION data implementation methods, I will not talk about it here! The idea of implementing SSO across main domains

The same primary domain (that is, all subdomains under the same level-1 domain name) includes multiple server sharing SESSION data implementation methods, which are not described here!

The key issue is the implementation of SSO in different primary domains! This problem is complicated and can be implemented, but many of them are supported by some special software systems...

In fact, SESSION also requires COOKIE support. If COOKIE does not support cross-primary domain, the SESSION cannot cross-primary domain! So, how to implement cross-primary domain ???

This is a simple method that I suddenly think of when implementing SSO in my project.

I. assume there is. COM, B. COM, C. COM, where. COM is mainly responsible for verifying the pass (fast), B. COM and C. COM is a specific application

2. Some applications of B. COM, C. COM, and A. COM require A. COM to gain trust (login)

3. assign A subdomain passport. B. COM and passport. C. COM to each primary domain. their IP addresses all point to the host address of A. COM.

4. after the login passes verification, the user sets up a jump rule with session_id as the parameter to jump to the passport one by one. b. COM, passport. c. COM (in fact, these subdomains can be built to the default site of host A, and can be quickly redirected one by one through arrays and some parameters), jump directly using the PHP header ("Location: passport. b. COM /? Sid = xxxxxxxx & I = 0 "); at the same time, overwrite the session_id of the current primary domain as the passed session_id.

Here are some considerations:
1. assigning passport. X. COM to a host with a relatively high speed is helpful for fast jump, and users cannot see the complicated jump process...
2. jump on the same host to avoid jump failure due to errors in the intermediate jump link.

I only tested it on the simulated multi-primary domain on the local machine. The results are good. no specific tests have been conducted on the INTERNET. please try it if you are free, and propose a better SSO solution...

Using the same primary domain (that is, all subdomains under the same level-1 domain name) includes multiple server sharing SESSION data implementation methods. I will not talk about it here !...

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.