上一篇我根据框架中OAuth2.0的使用总结,画了SSO单点登录之OAuth2.0 登出流程,今天我们看一下根据用户token获取yoghurt信息的流程:
Java代码
/**
* 根据token获取用户信息
* @param accessToken
* @return
* @throws Exception
*/
@RequestMapping(value = "/user/token/{accesstoken}", method = RequestMethod.GET)
public ResponseVO getUserByToken(@PathVariable(value = "accessToken", required = true) String accessToken,@RequestHeader(value = "userId", required = true) Long userId) throws Exception {