Class WebAuthnConfigurer<H extends HttpSecurityBuilder<H>>
java.lang.Object
org.springframework.security.config.annotation.SecurityConfigurerAdapter<DefaultSecurityFilterChain,B>
org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<WebAuthnConfigurer<H>,H>
org.springframework.security.config.annotation.web.configurers.WebAuthnConfigurer<H>
- Type Parameters:
H- the type of builder
- All Implemented Interfaces:
SecurityConfigurer<DefaultSecurityFilterChain,H>
public class WebAuthnConfigurer<H extends HttpSecurityBuilder<H>>
extends AbstractHttpConfigurer<WebAuthnConfigurer<H>,H>
Configures WebAuthn for Spring Security applications
- Since:
- 6.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowedOrigins(String... allowedOrigins) Convenience method forallowedOrigins(Set)allowedOrigins(Set<String> allowedOrigins) Sets the allowed origins.voidConfigure theSecurityBuilderby setting the necessary properties on theSecurityBuilder.creationOptionsRepository(PublicKeyCredentialCreationOptionsRepository creationOptionsRepository) Sets PublicKeyCredentialCreationOptionsRepositorydisableDefaultRegistrationPage(boolean disable) Configures whether the default webauthn registration should be disabled.voidInitialize theSecurityBuilder.messageConverter(org.springframework.http.converter.HttpMessageConverter<Object> converter) SetsHttpMessageConverterused for WebAuthn to read/write to the HTTP request/response.The Relying Party id.Sets the relying party nameMethods inherited from class org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer
disable, getRequestMatcherBuilder, getSecurityContextHolderStrategy, withObjectPostProcessorMethods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter
addObjectPostProcessor, getBuilder, postProcess, setBuilder
-
Constructor Details
-
WebAuthnConfigurer
public WebAuthnConfigurer()
-
-
Method Details
-
rpId
The Relying Party id.- Parameters:
rpId- the relying party id- Returns:
- the
WebAuthnConfigurerfor further customization
-
rpName
Sets the relying party name- Parameters:
rpName- the relying party name- Returns:
- the
WebAuthnConfigurerfor further customization
-
allowedOrigins
Convenience method forallowedOrigins(Set)- Parameters:
allowedOrigins- the allowed origins- Returns:
- the
WebAuthnConfigurerfor further customization - See Also:
-
allowedOrigins
Sets the allowed origins.- Parameters:
allowedOrigins- the allowed origins- Returns:
- the
WebAuthnConfigurerfor further customization - See Also:
-
disableDefaultRegistrationPage
Configures whether the default webauthn registration should be disabled. Setting it totruewill prevent the configurer from registering theDefaultWebAuthnRegistrationPageGeneratingFilter.- Parameters:
disable- disable the default registration page if true, enable it otherwise- Returns:
- the
WebAuthnConfigurerfor further customization
-
messageConverter
public WebAuthnConfigurer<H> messageConverter(org.springframework.http.converter.HttpMessageConverter<Object> converter) SetsHttpMessageConverterused for WebAuthn to read/write to the HTTP request/response.- Parameters:
converter- theHttpMessageConverter- Returns:
- the
WebAuthnConfigurerfor further customization
-
creationOptionsRepository
public WebAuthnConfigurer<H> creationOptionsRepository(PublicKeyCredentialCreationOptionsRepository creationOptionsRepository) Sets PublicKeyCredentialCreationOptionsRepository- Parameters:
creationOptionsRepository- the creationOptionsRepository- Returns:
- the
WebAuthnConfigurerfor further customization
-
init
Description copied from interface:SecurityConfigurerInitialize theSecurityBuilder. Here only shared state should be created and modified, but not properties on theSecurityBuilderused for building the object. This ensures that theSecurityConfigurer.configure(SecurityBuilder)method uses the correct shared objects when building. Configurers should be applied here.- Specified by:
initin interfaceSecurityConfigurer<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>> - Overrides:
initin classSecurityConfigurerAdapter<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
-
configure
Description copied from interface:SecurityConfigurerConfigure theSecurityBuilderby setting the necessary properties on theSecurityBuilder.- Specified by:
configurein interfaceSecurityConfigurer<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>> - Overrides:
configurein classSecurityConfigurerAdapter<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
-