Class RequiredFactor
java.lang.Object
org.springframework.security.authorization.RequiredFactor
The requirements for an
GrantedAuthority to be considered a valid factor.
- If the
getAuthority()is specified, then it must matchGrantedAuthority.getAuthority() - If
getValidDuration()is specified, the matchingGrantedAuthoritymust be of typeFactorGrantedAuthorityandFactorGrantedAuthority.getIssuedAt()must be such that it is not considered expired when compared togetValidDuration().
- Since:
- 7.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic RequiredFactor.Builderbuilder()Creates a newRequiredFactor.Builder.booleanThe expectedGrantedAuthority.getAuthority().@Nullable DurationHow long theFactorGrantedAuthorityis valid for.inthashCode()toString()static RequiredFactor.BuilderwithAuthority(String authority) Creates aRequiredFactor.Builderwith the specified authority.
-
Method Details
-
getAuthority
The expectedGrantedAuthority.getAuthority().- Returns:
- the authority.
-
getValidDuration
How long theFactorGrantedAuthorityis valid for.- Returns:
-
equals
-
hashCode
public int hashCode() -
toString
-
withAuthority
Creates aRequiredFactor.Builderwith the specified authority.- Parameters:
authority- the authority.- Returns:
- the builder.
-
builder
Creates a newRequiredFactor.Builder.- Returns:
-