public class KeycloakAuthenticationProcessingFilter
extends org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
implements org.springframework.context.ApplicationContextAware
Modifier and Type | Field and Description |
---|---|
static org.springframework.security.web.util.matcher.RequestMatcher |
DEFAULT_REQUEST_MATCHER
Request matcher that matches requests to the
default login URI
and any request with a Authorization header. |
Constructor and Description |
---|
KeycloakAuthenticationProcessingFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager)
Creates a new Keycloak authentication processing filter with given
AuthenticationManager and the
default request matcher . |
KeycloakAuthenticationProcessingFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager,
org.springframework.security.web.util.matcher.RequestMatcher requiresAuthenticationRequestMatcher)
Creates a new Keycloak authentication processing filter with given
AuthenticationManager and
RequestMatcher . |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
org.springframework.security.core.Authentication |
attemptAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
doFilter, getAllowSessionCreation, getAuthenticationManager, getFailureHandler, getFilterProcessesUrl, getRememberMeServices, getSuccessHandler, requiresAuthentication, setAllowSessionCreation, setApplicationEventPublisher, setAuthenticationDetailsSource, setAuthenticationFailureHandler, setAuthenticationManager, setAuthenticationSuccessHandler, setContinueChainBeforeSuccessfulAuthentication, setFilterProcessesUrl, setMessageSource, setRememberMeServices, setRequiresAuthenticationRequestMatcher, setSessionAuthenticationStrategy, successfulAuthentication, successfulAuthentication, unsuccessfulAuthentication
public static final org.springframework.security.web.util.matcher.RequestMatcher DEFAULT_REQUEST_MATCHER
default login URI
and any request with a Authorization
header.public KeycloakAuthenticationProcessingFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager)
AuthenticationManager
and the
default request matcher
.authenticationManager
- the AuthenticationManager
to authenticate requests (cannot be null)DEFAULT_REQUEST_MATCHER
public KeycloakAuthenticationProcessingFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager, org.springframework.security.web.util.matcher.RequestMatcher requiresAuthenticationRequestMatcher)
AuthenticationManager
and
RequestMatcher
.
Note: the given request matcher must support matching the Authorization
header if
bearer token authentication is to be accepted.
authenticationManager
- the AuthenticationManager
to authenticate requests (cannot be null)requiresAuthenticationRequestMatcher
- the RequestMatcher
used to determine if authentication
is required (cannot be null)RequestHeaderRequestMatcher
,
OrRequestMatcher
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
public org.springframework.security.core.Authentication attemptAuthentication(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws org.springframework.security.core.AuthenticationException, IOException, javax.servlet.ServletException
attemptAuthentication
in class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
org.springframework.security.core.AuthenticationException
IOException
javax.servlet.ServletException
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
Copyright © 2015 JBoss by Red Hat. All rights reserved.