ca.gc.aafc.dina.security.KeycloakConfigResolverConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dina-base-api Show documentation
Show all versions of dina-base-api Show documentation
Base DINA API package for Java built on SpringBoot and Crnk
package ca.gc.aafc.dina.security;
import lombok.extern.log4j.Log4j2;
import org.keycloak.adapters.KeycloakConfigResolver;
import org.keycloak.adapters.springboot.KeycloakSpringBootConfigResolver;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Since KeycloakAuthConfig is extending KeycloakWebSecurityConfigurerAdapter it creates a circular dependency
* with KeycloakConfigResolver.
* This configuration class is simply to externalize the KeycloakConfigResolver bean creation.
*/
@Configuration
@ConditionalOnProperty(value = "keycloak.enabled", matchIfMissing = true)
@Log4j2
public class KeycloakConfigResolverConfig {
@Bean
public KeycloakConfigResolver keycloakConfigResolver() {
log.debug("Creating KeycloakSpringBootConfigResolver bean");
return new KeycloakSpringBootConfigResolver();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy