Mobile device Single Sign-on feature implementation

Source: Internet
Author: User

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

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.