Ideas:
When the user entered the user name and password correctly, click Confirm login, background Single sign-on system (Simple-sso) to obtain the user name and password, correct than the end of the user name and password, to the currently logged on user to generate a login credentials (token),
String token = username+ "&" +system.currenttimemillis (), then returns the token value to the mobile side while saving the login credentials of the login user in the Redis cache.
However, before generating tokens to determine whether this user has already logged on on another device, if logged in to the original stored in the Redis user credentials deleted, regenerate a new token, return to the mobile side, and re-save a copy in Redis.
Specific implementation:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/9F/wKiom1YCSTzxHF6-AAJKbd_kepQ608.jpg "style=" float: none; "title=" 1.png "alt=" Wkiom1ycstzxhf6-aajkbd_kepq608.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/9C/wKioL1YCST6Q27gsAANqGa5T0gA237.jpg "style=" float: none; "title=" 2.png "alt=" Wkiol1ycst6q27gsaanqga5t0ga237.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/9F/wKiom1YCST3zrikVAAPjQHzh2ZE413.jpg "style=" float: none; "title=" 3.png "alt=" Wkiom1ycst3zrikvaapjqhzh2ze413.jpg "/>
which
1, the user information storage has two parts, one is basic (basic) information, one is detailed (detail) information.
2. The Stored user information is stored using the hash storage structure in Redis.
The following structure is stored:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/9F/wKiom1YCSVTg5TfLAAD4l4YkV-U685.jpg "title=" 4.png " alt= "Wkiom1ycsvtg5tflaad4l4ykv-u685.jpg"/>
This article is from the "Simple Life" blog, so be sure to keep this source http://simplelife.blog.51cto.com/9954761/1697451
Mobile device Single Sign-on feature implementation