spring oauth2怎么获取当前用户

如题所述

第1个回答  2017-04-22
数据库保存你最后获取到的access_token就可以了
第2个回答  2019-08-21
授权后在在任意controller中配置:
@RequestMapping(value = "/user", method = RequestMethod.GET)
@ResponseBody
public Object currentUserName(Principal principal) {
return principal;
}
相似回答