Search in sources :

Example 1 with KeycloakAuthenticationProcessingFilter

use of org.keycloak.adapters.springsecurity.filter.KeycloakAuthenticationProcessingFilter in project keycloak by keycloak.

the class KeycloakWebSecurityConfigurerAdapter method keycloakAuthenticationProcessingFilter.

@Bean
protected KeycloakAuthenticationProcessingFilter keycloakAuthenticationProcessingFilter() throws Exception {
    KeycloakAuthenticationProcessingFilter filter = new KeycloakAuthenticationProcessingFilter(authenticationManagerBean());
    filter.setSessionAuthenticationStrategy(sessionAuthenticationStrategy());
    return filter;
}
Also used : KeycloakAuthenticationProcessingFilter(org.keycloak.adapters.springsecurity.filter.KeycloakAuthenticationProcessingFilter) AdapterDeploymentContextFactoryBean(org.keycloak.adapters.springsecurity.AdapterDeploymentContextFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with KeycloakAuthenticationProcessingFilter

use of org.keycloak.adapters.springsecurity.filter.KeycloakAuthenticationProcessingFilter in project vboard by voyages-sncf-technologies.

the class WebSecurityConfig method keycloakAuthenticationProcessingFilter.

private KeycloakAuthenticationProcessingFilter keycloakAuthenticationProcessingFilter() throws Exception {
    KeycloakAuthenticationProcessingFilter filter = new KeycloakAuthenticationProcessingFilter(authenticationManagerBean());
    filter.setSessionAuthenticationStrategy(SESSION_AUTH_STRATEGY);
    // required for below function
    filter.setApplicationContext(applicationContext);
    // sets adapterDeploymentContext by retrieving Bean
    filter.afterPropertiesSet();
    return filter;
}
Also used : KeycloakAuthenticationProcessingFilter(org.keycloak.adapters.springsecurity.filter.KeycloakAuthenticationProcessingFilter)

Example 3 with KeycloakAuthenticationProcessingFilter

use of org.keycloak.adapters.springsecurity.filter.KeycloakAuthenticationProcessingFilter in project shinyproxy by openanalytics.

the class KeycloakAuthenticationBackend method keycloakAuthenticationProcessingFilter.

@Bean
@ConditionalOnProperty(name = "shiny.proxy.authentication", havingValue = "keycloak")
protected KeycloakAuthenticationProcessingFilter keycloakAuthenticationProcessingFilter() throws Exception {
    KeycloakAuthenticationProcessingFilter filter = new KeycloakAuthenticationProcessingFilter(authenticationManager);
    filter.setSessionAuthenticationStrategy(sessionAuthenticationStrategy());
    // Fix: call afterPropertiesSet manually, because Spring doesn't invoke it for some reason.
    filter.setApplicationContext(ctx);
    filter.afterPropertiesSet();
    return filter;
}
Also used : KeycloakAuthenticationProcessingFilter(org.keycloak.adapters.springsecurity.filter.KeycloakAuthenticationProcessingFilter) AdapterDeploymentContextFactoryBean(org.keycloak.adapters.springsecurity.AdapterDeploymentContextFactoryBean) Bean(org.springframework.context.annotation.Bean) ConditionalOnProperty(org.springframework.boot.autoconfigure.condition.ConditionalOnProperty)

Aggregations

KeycloakAuthenticationProcessingFilter (org.keycloak.adapters.springsecurity.filter.KeycloakAuthenticationProcessingFilter)3 AdapterDeploymentContextFactoryBean (org.keycloak.adapters.springsecurity.AdapterDeploymentContextFactoryBean)2 Bean (org.springframework.context.annotation.Bean)2 ConditionalOnProperty (org.springframework.boot.autoconfigure.condition.ConditionalOnProperty)1