Single sign-on framework

1. The concept: that is, multiple servers mutual trust, as long as a system login, other systems do not need to log on trust, direct access

2. The core idea (based filter, cookie and token technology)

3. Principle:

   1) When a client access, filter will intercept all requests, first of all get token information value (saved by logging prefix key acquisition) from the cookie then all of them token to redis inquire whether there had been a user's login information, if the query data (user is empty), then carry the current request address to jump to a unified login page.

   2) When the unified login page to log in, the login information (user) to query the database current information is correct,

          If not, jump back to the login page,

          If the login information is correct, a token is generated based on the user information, key: Snow algorithm to generate a unique token, value: redis which is stored in the user currently logged on, and this token in a cookie save them, key: any prefix, value: as a token information, any request redirected to the beginning of the address.

4. Note: All mutual trust server login data source remains the same.

 

Guess you like

Origin www.cnblogs.com/lq-93/p/12664051.html