sc-sc - 云代码空间
——
上一篇是站在巨人的肩膀上去研究OAuth2.0,也是为了快速帮助大家认识OAuth2.0,闲话少说,我根据框架中OAuth2.0的使用总结,画了一个简单的流程图(根据用户名+密码实现OAuth2.0的登录认证):
上面的图很清楚的描述了当前登录login的流程,现在我们针对于login做成相关的微服务,解析如下:
Headers: Content-Type: application/json Authorization: Basic QXkjkdkYkhfeyKOKKHUM67ejfjeSfnrRdk5nPT0= Body:{ "userName":"admin", ---也可以是手机号码等 "password": "e10adc3949ba59abbe56e057f20f883e" } 返回值类型: application/json 返回的结果集: { "code": "200", "message": "Success", "version": "v1.0", "data": { "userInfo": { "userId": "00001", "pwd": "e10adc3949ba59abbe56e057f20f883e", "userName": "admin", "mobile": "15875500000", "telephone": "", "wechat": "", "email": "xxx@qq.com", "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" } } }