use of org.cloudfoundry.promregator.auth.OAuth2XSUAAEnricher in project promregator by promregator.
the class PromregatorApplication method authenticationEnricher.
@Bean
public AuthenticationEnricher authenticationEnricher(PromregatorConfiguration promregatorConfiguration) {
AuthenticationEnricher ae = null;
String type = promregatorConfiguration.getAuthenticator().getType();
if ("OAuth2XSUAA".equalsIgnoreCase(type)) {
ae = new OAuth2XSUAAEnricher(promregatorConfiguration.getAuthenticator().getOauth2xsuaa());
} else if ("none".equalsIgnoreCase(type) || "null".equalsIgnoreCase(type)) {
ae = new NullEnricher();
} else if ("basic".equalsIgnoreCase(type)) {
ae = new BasicAuthenticationEnricher(promregatorConfiguration.getAuthenticator().getBasic());
} else {
log.warn(String.format("Authenticator type %s is unknown; skipping", type));
}
return ae;
}
Aggregations