[英]Extract data from Principal in Java Spring Boot
Something like this can work.像这样的东西可以工作。 It's always a bit nasty to get those properties.
获得这些属性总是有点讨厌。
@RequestMapping("/user")
public void user(Authentication authentication) {
LinkedHashMap<String, Object> properties = (LinkedHashMap<String, Object>) authentication.getDetails();
String loginProperty = properties.get("login");
//Do what you want to do with your property
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.