mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge pull request #5053 from spauk/master
* pull5053: Make UserInfoTokenServices.getPrincipal protected
This commit is contained in:
commit
a2f482b7f3
@ -99,7 +99,13 @@ public class UserInfoTokenServices implements ResourceServerTokenServices {
|
||||
return new OAuth2Authentication(request, token);
|
||||
}
|
||||
|
||||
private Object getPrincipal(Map<String, Object> map) {
|
||||
/**
|
||||
* Return the principal that should be used for the token. The default implementation
|
||||
* looks for well know {@code user*} keys in the map.
|
||||
* @param map the source map
|
||||
* @return the principal or {@literal "unknown"}
|
||||
*/
|
||||
protected Object getPrincipal(Map<String, Object> map) {
|
||||
for (String key : PRINCIPAL_KEYS) {
|
||||
if (map.containsKey(key)) {
|
||||
return map.get(key);
|
||||
|
Loading…
Reference in New Issue
Block a user