How to implement single sign-on for two PHP applications and one Java application

Source: Internet
Author: User
How can I implement single-point logon between two PHP applications and one Java application? I would like to ask two PHP applications and one Java application. the databases of each application are isolated from each other, but they are in the same domain: app1.domain.com, app2.domain.com, and app3.domain. comPHP: how does one implement single sign-on for two PHP applications and one Java application?
I would like to ask two PHP applications and one Java application. the databases of each application are isolated from each other, but they are in the same domain:
For example, app1.domain.com, app2.domain.com, and app3.domain.com
PHP is developed based on Apahce + PHP 5.2, and Java applications are developed based on GlassFish 3.1.2.

Is there any way to achieve single-point logon?

------ Solution --------------------
Java
Cookie myCookie = new Cookie ......
MyCookie. setDomain (".domain.com ");
......


Php

Setcookie ("key", $ value, $ time, "/", ".domain.com ");





------ Solution --------------------
Passing the login information through js does not matter whether it is in the same domain
------ Solution --------------------
Create a public identity authentication system.
When a user logs on to an application system, a unique token is sent to the user. when the user accesses other applications, the token is used. the identity authentication system determines that the user has logged on.
For specific implementation, refer to the SSO systems of many companies.

For web applications, the simplest method is cookie.

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.