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 matchingGrantedAuthority
must be of typeFactorGrantedAuthority
andFactorGrantedAuthority.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.Builder
builder()
Creates a newRequiredFactor.Builder
.boolean
The expectedGrantedAuthority.getAuthority()
.@Nullable Duration
How long theFactorGrantedAuthority
is valid for.int
hashCode()
toString()
static RequiredFactor.Builder
withAuthority
(String authority) Creates aRequiredFactor.Builder
with the specified authority.
-
Method Details
-
getAuthority
The expectedGrantedAuthority.getAuthority()
.- Returns:
- the authority.
-
getValidDuration
How long theFactorGrantedAuthority
is valid for.- Returns:
-
equals
-
hashCode
public int hashCode() -
toString
-
withAuthority
Creates aRequiredFactor.Builder
with the specified authority.- Parameters:
authority
- the authority.- Returns:
- the builder.
-
builder
Creates a newRequiredFactor.Builder
.- Returns:
-