Package org.opencastproject.security.jwt
Class JWTRequestParameterAuthenticationFilter
- java.lang.Object
-
- org.springframework.web.filter.GenericFilterBean
-
- org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter
-
- org.opencastproject.security.jwt.JWTRequestParameterAuthenticationFilter
-
- All Implemented Interfaces:
javax.servlet.Filter,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationEventPublisherAware,org.springframework.context.EnvironmentAware,org.springframework.web.context.ServletContextAware
public class JWTRequestParameterAuthenticationFilter extends org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilterAuthentication filter for JWTs in request parameters. What exactly this means depends on the request method. Specifically, forGETrequests, the JWT is looked up in the query parameters. ForPOSTthis expects a form body and the JWT is read from there.
-
-
Constructor Summary
Constructors Constructor Description JWTRequestParameterAuthenticationFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected ObjectgetPreAuthenticatedCredentials(javax.servlet.http.HttpServletRequest request)protected ObjectgetPreAuthenticatedPrincipal(javax.servlet.http.HttpServletRequest request)voidsetDebug(boolean debug)Setter for the debug switch.voidsetExceptionIfParameterMissing(boolean exceptionIfParameterMissing)Defines whether an exception should be raised if the principal parameter is missing.voidsetLoginHandler(JWTLoginHandler loginHandler)Setter for the login handler.voidsetParameterName(String parameterName)Setter for the parameter name.-
Methods inherited from class org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter
doFilter, getAuthenticationDetailsSource, setApplicationEventPublisher, setAuthenticationDetailsSource, setAuthenticationManager, setCheckForPrincipalChanges, setContinueFilterChainOnUnsuccessfulAuthentication, setInvalidateSessionOnPrincipalChange, successfulAuthentication, unsuccessfulAuthentication
-
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classorg.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter
-
getPreAuthenticatedPrincipal
protected Object getPreAuthenticatedPrincipal(javax.servlet.http.HttpServletRequest request)
- Specified by:
getPreAuthenticatedPrincipalin classorg.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter
-
getPreAuthenticatedCredentials
protected Object getPreAuthenticatedCredentials(javax.servlet.http.HttpServletRequest request)
- Specified by:
getPreAuthenticatedCredentialsin classorg.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter
-
setParameterName
public void setParameterName(String parameterName)
Setter for the parameter name.- Parameters:
parameterName- The parameter name.
-
setLoginHandler
public void setLoginHandler(JWTLoginHandler loginHandler)
Setter for the login handler.- Parameters:
loginHandler- The login handler.
-
setExceptionIfParameterMissing
public void setExceptionIfParameterMissing(boolean exceptionIfParameterMissing)
Defines whether an exception should be raised if the principal parameter is missing. Defaults to true.- Parameters:
exceptionIfParameterMissing- set tofalseto override the default behaviour and allow the request to proceed if no parameter is found.
-
setDebug
public void setDebug(boolean debug)
Setter for the debug switch.- Parameters:
debug- Value for the debug switch.
-
-