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