Integrated Spring Cloud Cloud architecture-SSO Single Sign-on OAuth2.0 login process (2)

Source: Internet
Author: User

The previous article is standing on the shoulders of giants to study OAuth2.0, but also to quickly help you know OAuth2.0, gossip less, I based on the framework of the use of OAuth2.0 summary, draw a simple flowchart (according to user name + password to achieve OAuth2.0 login authentication):



The diagram above clearly describes the current log in login process, and now we make the relevant micro-service for login, parsing the following:

Request Method: POST
Service Url:http://localhost:8080/user/login
Parameter type: Application/json

headers:content-type:application/JSON authorization:basic qxkjkdkykhfeykokkhum67ejfjesfnrrdk5npt0=body:{"UserName":"Admin",  ---It could be a cell phone number, etc."Password":"e10adc3949ba59abbe56e057f20f883e"} return value type: Application/The result set returned by JSON: {"Code":" $",  "message":"Success",  "version":"v1.0",  "Data": {    "UserInfo": {      "userId":"00001",      "pwd":"e10adc3949ba59abbe56e057f20f883e",      "UserName":"Admin",      "Mobile":"15875500000",      "Telephone":"",      "WeChat":"",      "Email":"[email protected]",      "Status":"1",      "Createtime":"2017-06-26"     },    "Roleids":" -",    "TokenInfo": {      "Accesstoken":"4DE55A69-E372-4766-ACD3-1C419D6F2FDA",      "Tokentype":"Bearer",      "webtokent":"uhsljfjoqwu4t4paqczh1sn0fp7puwklupns+x1dz8r9gx+njkbi7w==",      "Refreshtoken":"d3d71594-5c3f-4a68-a7e5-b8d21c4fa73b",      "Expiresin":34644,      "Scope":"Read Write"     }   } } 
    1. Note: You can test with the Postman tool
    2. Framework Design idea: Provide independent Commonservice-sso microservices, provide component-sso dependent components, and provide micro-service client User-service Micro-service interface for user login.
    3. The entire execution process is as follows: User-service---> Commonservice-sso---> Component-sso
    4. The service gateway is not explained here, and it is later related to how service authentication and authentication are implemented between the service gateway and SSO single Sign-on.
    5. From now on, I will be documenting the process and essence of the recent development of the spring cloud micro-service cloud architecture to help more friends who are interested in developing the Spring cloud framework to explore the process of building the spring cloud architecture and how to use it in enterprise projects.

Integrated Spring Cloud Cloud architecture-SSO Single Sign-on OAuth2.0 login process (2)

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.