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",  ---也可以是手机号码等      "password": "e10adc3949ba59abbe56e057f20f883e"  

Return value type: Application/json
The result set returned:

{ "code": "200", "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": "100",   "tokenInfo": {     "accessToken":"4de55a69-e372-4766-acd3-1c419d6f2fda",     "tokenType": "bearer",     "webTokent":"uHSLjfJoQwU4t4PAqCzH1SN0fp7PUWKluPNS+x1dZ8R9Gx+NJkBI7w==",     "refreshToken":"d3d71594-5c3f-4a68-a7e5-b8d21c4fa73b",     "expiresIn": 34644,     "scope": "read write"    }  

Note: You can test with the Postman tool
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.

The entire execution process is as follows: User-service---> Commonservice-sso---> Component-sso
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.

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