Class OidcUserInfoEndpointFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.springframework.security.oauth2.server.authorization.oidc.web.OidcUserInfoEndpointFilter
- All Implemented Interfaces:
jakarta.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.EnvironmentAware,org.springframework.core.env.EnvironmentCapable,org.springframework.web.context.ServletContextAware
public final class OidcUserInfoEndpointFilter
extends org.springframework.web.filter.OncePerRequestFilter
A
Filter that processes OpenID Connect 1.0 UserInfo Requests.- Since:
- 0.2.1
- See Also:
-
OidcUserInfoOidcUserInfoAuthenticationProvider- 5.3. UserInfo Endpoint
-
Field Summary
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIXFields inherited from class org.springframework.web.filter.GenericFilterBean
logger -
Constructor Summary
ConstructorsConstructorDescriptionOidcUserInfoEndpointFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager) Constructs anOidcUserInfoEndpointFilterusing the provided parameters.OidcUserInfoEndpointFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager, String userInfoEndpointUri) Constructs anOidcUserInfoEndpointFilterusing the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoFilterInternal(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain) voidsetAuthenticationConverter(org.springframework.security.web.authentication.AuthenticationConverter authenticationConverter) Sets theAuthenticationConverterused when attempting to extract an UserInfo Request fromHttpServletRequestto an instance ofOidcUserInfoAuthenticationTokenused for authenticating the request.voidsetAuthenticationFailureHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler authenticationFailureHandler) Sets theAuthenticationFailureHandlerused for handling anOAuth2AuthenticationExceptionand returning theError Response.voidsetAuthenticationSuccessHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler authenticationSuccessHandler) Sets theAuthenticationSuccessHandlerused for handling anOidcUserInfoAuthenticationTokenand returning theUserInfo Response.Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatchMethods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Constructor Details
-
OidcUserInfoEndpointFilter
public OidcUserInfoEndpointFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager) Constructs anOidcUserInfoEndpointFilterusing the provided parameters.- Parameters:
authenticationManager- the authentication manager
-
OidcUserInfoEndpointFilter
public OidcUserInfoEndpointFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager, String userInfoEndpointUri) Constructs anOidcUserInfoEndpointFilterusing the provided parameters.- Parameters:
authenticationManager- the authentication manageruserInfoEndpointUri- the endpointURIfor OpenID Connect 1.0 UserInfo Requests
-
-
Method Details
-
doFilterInternal
protected void doFilterInternal(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain) throws jakarta.servlet.ServletException, IOException - Specified by:
doFilterInternalin classorg.springframework.web.filter.OncePerRequestFilter- Throws:
jakarta.servlet.ServletExceptionIOException
-
setAuthenticationConverter
public void setAuthenticationConverter(org.springframework.security.web.authentication.AuthenticationConverter authenticationConverter) Sets theAuthenticationConverterused when attempting to extract an UserInfo Request fromHttpServletRequestto an instance ofOidcUserInfoAuthenticationTokenused for authenticating the request.- Parameters:
authenticationConverter- theAuthenticationConverterused when attempting to extract an UserInfo Request fromHttpServletRequest- Since:
- 0.4.0
-
setAuthenticationSuccessHandler
public void setAuthenticationSuccessHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler authenticationSuccessHandler) Sets theAuthenticationSuccessHandlerused for handling anOidcUserInfoAuthenticationTokenand returning theUserInfo Response.- Parameters:
authenticationSuccessHandler- theAuthenticationSuccessHandlerused for handling anOidcUserInfoAuthenticationToken- Since:
- 0.4.0
-
setAuthenticationFailureHandler
public void setAuthenticationFailureHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler authenticationFailureHandler) Sets theAuthenticationFailureHandlerused for handling anOAuth2AuthenticationExceptionand returning theError Response.- Parameters:
authenticationFailureHandler- theAuthenticationFailureHandlerused for handling anOAuth2AuthenticationException- Since:
- 0.4.0
-