SSO Single Sign-on PHP implementation method (Laravel framework), ssolaravel_php tutorial

Source: Internet
Author: User
Tags php web development

SSO Single Sign-on PHP implementation method (Laravel framework), Ssolaravel


Laravel is a simple, elegant PHP Web development Framework (PHP Web framework). It frees you from the messy code of noodles, and it helps you build a perfect web app, and every line of code can be concise and expressive.

Simply say my logic and I don't know if I understand SSO right.

If three sites a.baidu.com b.baidu.com c.baidu.com

A.baidu.com as the authenticating user login account.

B and C as the client (subsystem).

B and C need to log in to jump to a, and carry the parameter source indicates a link to jump after landing.

A site is the normal way of landing (check the user password), verify success after doing some processing. Need to generate a ticket, how to generate all can, as long as the security is possible. It is then stored inside the cache. Here are some questions, summarized later. After the successful landing directly to the \ (URL on it.)

"PHP private function Getticketurl (\) source) {\ (ticket = MD5 (time () +key); Cache::p ut (\) ticket, $user, $url = $source. '? ticket= '. $ticket; return $url;}

If say a station with ticket jump to B station (b.baidu.com?ticket=xxxxxxxxxxxxxxxx ")

B Station make a global filter, accept this ticket and then request a station to verify whether ticket is a generated.

B Station filter App\http\middleware\casauthenticate code, here to determine whether there is a ticket and send a request to a station check. If it is logged in, then get the user uid to login.

The logic is complete, but there are a few questions.

1. I realize this, I do not know whether it is right, which I wrote according to the principle.

2. If B station now jump to C station, because B station active more frequent, the session has been in, and a station cache time very likely has expired, at this time from B station jump to C station, C station jump to a station to judge the landing, the results found that has failed, or have to land. So this is problematic, due to our business module is not relevant, not at random to jump, so temporarily do not consider such a problem. But this is really a problem for me. I didn't think clearly.

About SSO Single Sign-on PHP implementation method (Laravel framework), small series on the introduction of so many people, I hope to help!

Articles you may be interested in:

    • Based on. NET Single Sign-on (SSO) Implementation Solutions
    • PHP SSO Single Sign-on implementation method
    • ASP. NET simple way to implement single sign-on (SSO)

http://www.bkjia.com/PHPjc/1113709.html www.bkjia.com true http://www.bkjia.com/PHPjc/1113709.html techarticle SSO Single Sign-on PHP implementation method (Laravel framework), Ssolaravel Laravel is a set of concise, elegant PHP Web development Framework (PHP Web framework). It can make you a messy generation from noodles ...

  • 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.