Search in sources :

Example 1 with OAuth2XSUAAEnricher

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;
}
Also used : OAuth2XSUAAEnricher(org.cloudfoundry.promregator.auth.OAuth2XSUAAEnricher) NullEnricher(org.cloudfoundry.promregator.auth.NullEnricher) BasicAuthenticationEnricher(org.cloudfoundry.promregator.auth.BasicAuthenticationEnricher) AuthenticationEnricher(org.cloudfoundry.promregator.auth.AuthenticationEnricher) BasicAuthenticationEnricher(org.cloudfoundry.promregator.auth.BasicAuthenticationEnricher) Bean(org.springframework.context.annotation.Bean)

Aggregations

AuthenticationEnricher (org.cloudfoundry.promregator.auth.AuthenticationEnricher)1 BasicAuthenticationEnricher (org.cloudfoundry.promregator.auth.BasicAuthenticationEnricher)1 NullEnricher (org.cloudfoundry.promregator.auth.NullEnricher)1 OAuth2XSUAAEnricher (org.cloudfoundry.promregator.auth.OAuth2XSUAAEnricher)1 Bean (org.springframework.context.annotation.Bean)1