Class PublicKeyCredentialCreationOptionsFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.springframework.security.web.webauthn.registration.PublicKeyCredentialCreationOptionsFilter
- 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 class PublicKeyCredentialCreationOptionsFilter
extends org.springframework.web.filter.OncePerRequestFilter
-
Field Summary
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doFilterInternal
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain) void
setConverter
(org.springframework.http.converter.HttpMessageConverter<Object> converter) Set theHttpMessageConverter
to read theWebAuthnRegistrationFilter.WebAuthnRegistrationRequest
and write the response.void
setCreationOptionsRepository
(PublicKeyCredentialCreationOptionsRepository creationOptionsRepository) Sets thePublicKeyCredentialCreationOptionsRepository
to use.void
setRequestMatcher
(RequestMatcher requestMatcher) Sets theRequestMatcher
used to trigger this filter.Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Constructor Details
-
PublicKeyCredentialCreationOptionsFilter
Creates a new instance.- Parameters:
rpOperations
- theWebAuthnRelyingPartyOperations
to use. Cannot be null.
-
-
Method Details
-
setRequestMatcher
Sets theRequestMatcher
used to trigger this filter.By default, the
RequestMatcher
isPOST /webauthn/register/options
.- Parameters:
requestMatcher
- theRequestMatcher
to use- Since:
- 6.5
-
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:
doFilterInternal
in classorg.springframework.web.filter.OncePerRequestFilter
- Throws:
jakarta.servlet.ServletException
IOException
-
setCreationOptionsRepository
public void setCreationOptionsRepository(PublicKeyCredentialCreationOptionsRepository creationOptionsRepository) Sets thePublicKeyCredentialCreationOptionsRepository
to use. The default isHttpSessionPublicKeyCredentialCreationOptionsRepository
.- Parameters:
creationOptionsRepository
- thePublicKeyCredentialCreationOptionsRepository
to use. Cannot be null.
-
setConverter
Set theHttpMessageConverter
to read theWebAuthnRegistrationFilter.WebAuthnRegistrationRequest
and write the response. The default isMappingJackson2HttpMessageConverter
.- Parameters:
converter
- theHttpMessageConverter
to use. Cannot be null.
-