org.cloudfoundry.identity.uaa.oauth.UaaTokenEnhancer Maven / Gradle / Ivy
package org.cloudfoundry.identity.uaa.oauth;
import java.util.HashMap;
import java.util.Map;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import static org.cloudfoundry.identity.uaa.oauth.token.ClaimConstants.EXTERNAL_ATTR;
public interface UaaTokenEnhancer {
Map getExternalAttributes(OAuth2Authentication authentication);
default Map enhance(Map claims, OAuth2Authentication authentication) {
Map result = new HashMap<>();
result.put(EXTERNAL_ATTR, getExternalAttributes(authentication));
return result;
}
}