org.springframework.security.oauth2.client.filter
Class OAuth2ClientAuthenticationProcessingFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
org.springframework.security.oauth2.client.filter.OAuth2ClientAuthenticationProcessingFilter
- All Implemented Interfaces:
- Filter, Aware, BeanNameAware, DisposableBean, InitializingBean, ApplicationEventPublisherAware, EnvironmentAware, MessageSourceAware, ServletContextAware
public class OAuth2ClientAuthenticationProcessingFilter
- extends org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
An OAuth2 client filter that can be used to acquire an OAuth2 access token from an authorization server, and load an
authentication object into the SecurityContext
- Author:
- Vidya Valmikinathan
| Fields inherited from class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter |
authenticationDetailsSource, eventPublisher, messages, SPRING_SECURITY_LAST_EXCEPTION_KEY |
| Methods inherited from class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter |
doFilter, getAllowSessionCreation, getAuthenticationManager, getFailureHandler, getFilterProcessesUrl, getRememberMeServices, getSuccessHandler, requiresAuthentication, setAllowSessionCreation, setApplicationEventPublisher, setAuthenticationDetailsSource, setAuthenticationFailureHandler, setAuthenticationManager, setAuthenticationSuccessHandler, setContinueChainBeforeSuccessfulAuthentication, setFilterProcessesUrl, setMessageSource, setRememberMeServices, setSessionAuthenticationStrategy, successfulAuthentication, successfulAuthentication |
| Methods inherited from class org.springframework.web.filter.GenericFilterBean |
addRequiredProperty, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
restTemplate
public OAuth2RestOperations restTemplate
OAuth2ClientAuthenticationProcessingFilter
public OAuth2ClientAuthenticationProcessingFilter(String defaultFilterProcessesUrl)
setTokenServices
public void setTokenServices(ResourceServerTokenServices tokenServices)
- Reference to a CheckTokenServices that can validate an OAuth2AccessToken
- Parameters:
tokenServices -
setRestTemplate
public void setRestTemplate(OAuth2RestOperations restTemplate)
- A rest template to be used to obtain an access token.
- Parameters:
restTemplate - a rest template
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet in interface InitializingBean- Overrides:
afterPropertiesSet in class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
attemptAuthentication
public org.springframework.security.core.Authentication attemptAuthentication(HttpServletRequest request,
HttpServletResponse response)
throws org.springframework.security.core.AuthenticationException,
IOException,
ServletException
- Specified by:
attemptAuthentication in class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
- Throws:
org.springframework.security.core.AuthenticationException
IOException
ServletException
unsuccessfulAuthentication
protected void unsuccessfulAuthentication(HttpServletRequest request,
HttpServletResponse response,
org.springframework.security.core.AuthenticationException failed)
throws IOException,
ServletException
- Overrides:
unsuccessfulAuthentication in class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
- Throws:
IOException
ServletException
Copyright © 2012. All Rights Reserved.