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": "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.
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. Source Source technical support for complete projects 1791743380
Spring Cloud Cloud architecture-SSO Single Sign-on OAuth2.0 login process (2)