Commit a2f482b7 authored by Phillip Webb's avatar Phillip Webb

Merge pull request #5053 from spauk/master

* pull5053:
  Make UserInfoTokenServices.getPrincipal protected
parents b1656be3 8542f4f4
...@@ -99,7 +99,13 @@ public class UserInfoTokenServices implements ResourceServerTokenServices { ...@@ -99,7 +99,13 @@ public class UserInfoTokenServices implements ResourceServerTokenServices {
return new OAuth2Authentication(request, token); 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) { for (String key : PRINCIPAL_KEYS) {
if (map.containsKey(key)) { if (map.containsKey(key)) {
return map.get(key); return map.get(key);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment