org.springframework.security.oauth2.provider.authentication
Class OAuth2AuthenticationProcessingFilter
java.lang.Object
org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter
- All Implemented Interfaces:
- javax.servlet.Filter, org.springframework.beans.factory.InitializingBean
public class OAuth2AuthenticationProcessingFilter
- extends Object
- implements javax.servlet.Filter, org.springframework.beans.factory.InitializingBean
A pre-authentication filter for OAuth2 protected resources. Extracts an OAuth2 token from the incoming request and
uses it to populate the Spring Security context with an OAuth2Authentication (if used in conjunction with an
OAuth2AuthenticationManager).
- Author:
- Dave Syer
|
Method Summary |
void |
afterPropertiesSet()
|
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
|
void |
init(javax.servlet.FilterConfig filterConfig)
|
protected String |
parseHeaderToken(javax.servlet.http.HttpServletRequest request)
Parse the OAuth header parameters. |
protected String |
parseToken(javax.servlet.http.HttpServletRequest request)
|
void |
setAuthenticationDetailsSource(org.springframework.security.authentication.AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
|
void |
setAuthenticationEntryPoint(org.springframework.security.web.AuthenticationEntryPoint authenticationEntryPoint)
|
void |
setAuthenticationManager(org.springframework.security.authentication.AuthenticationManager authenticationManager)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OAuth2AuthenticationProcessingFilter
public OAuth2AuthenticationProcessingFilter()
setAuthenticationEntryPoint
public void setAuthenticationEntryPoint(org.springframework.security.web.AuthenticationEntryPoint authenticationEntryPoint)
- Parameters:
authenticationEntryPoint - the authentication entry point to set
setAuthenticationManager
public void setAuthenticationManager(org.springframework.security.authentication.AuthenticationManager authenticationManager)
- Parameters:
authenticationManager - the authentication manager to set (mandatory with no default)
setAuthenticationDetailsSource
public void setAuthenticationDetailsSource(org.springframework.security.authentication.AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
- Parameters:
authenticationDetailsSource - The AuthenticationDetailsSource to use
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
doFilter
public void doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
- Specified by:
doFilter in interface javax.servlet.Filter
- Throws:
IOException
javax.servlet.ServletException
parseToken
protected String parseToken(javax.servlet.http.HttpServletRequest request)
parseHeaderToken
protected String parseHeaderToken(javax.servlet.http.HttpServletRequest request)
- Parse the OAuth header parameters. The parameters will be oauth-decoded.
- Parameters:
request - The request.
- Returns:
- The parsed parameters, or null if no OAuth authorization header was supplied.
init
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
- Specified by:
init in interface javax.servlet.Filter
- Throws:
javax.servlet.ServletException
destroy
public void destroy()
- Specified by:
destroy in interface javax.servlet.Filter
Copyright © 2013. All rights reserved.