Enum Class MultiFactorCondition
java.lang.Object
java.lang.Enum<MultiFactorCondition>
org.springframework.security.config.annotation.authorization.MultiFactorCondition
- All Implemented Interfaces:
Serializable, Comparable<MultiFactorCondition>, Constable
Condition under which multi-factor authentication is required.
- Since:
- 7.1
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRequire multi-factor authentication only when the user has a WebAuthn credential record registered. -
Method Summary
Modifier and TypeMethodDescriptionstatic MultiFactorConditionReturns the enum constant of this class with the specified name.static MultiFactorCondition[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
WEBAUTHN_REGISTERED
Require multi-factor authentication only when the user has a WebAuthn credential record registered.When this condition is specified,
EnableMultiFactorAuthentication.authorities()must includeFactorGrantedAuthority.WEBAUTHN_AUTHORITY. Failing to include it results in anIllegalArgumentExceptionwhen the configuration is processed.Using this condition also requires both a
PublicKeyCredentialUserEntityRepositoryBean and aUserCredentialRepositoryBean to be published.@Bean public PublicKeyCredentialUserEntityRepository userEntityRepository() { return new InMemoryPublicKeyCredentialUserEntityRepository(); } @Bean public UserCredentialRepository userCredentialRepository() { return new InMemoryUserCredentialRepository(); }
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-