Ask two PHP applications and a Java application how to implement single sign-on

Source: Internet
Author: User
How do two PHP applications and one Java application implement single Sign-on?
Ask two PHP applications and one Java application, each application database is isolated from each other, but in the same domain:
such as app1.domain.com, app2.domain.com and app3.domain.com
PHP is based on APAHCE + PHP 5.2 development, and Java applications are based on GlassFish 3.1.2 development.

Is there any way to do single sign-on?

------Solution--------------------
Java
Cookie MyCookie = new cookie ...
Mycookie.setdomain (". domain.com");
......


Php

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





------Solution--------------------
Passing the login information via JS is not related to the domain
------Solution--------------------
Make a common authentication system.
When a user logs in to an application, it is passed to the user a unique token flag, and when the user accesses another application, the token is taken, and the authentication system will assume that the user is logged in.
Specific implementations can refer to many of the company's SSO systems.

Web applications, the simplest is actually the way cookies are.
  • Related Article

    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.