Class PhoneSessionStepUp
java.lang.Object
com.irurueta.authserver.authorization.api.web.ott.PhoneSessionStepUp
The step-up rule of
StepUpGuard for a browser session instead of a bearer token: while the account has a
confirmed second factor, a sensitive change (removing the phone) needs a session that shows a multi-factor sign-in
made within authserver.mfa.step-up-max-age; an account without a second factor cannot step up, so it is not
asked to.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClockClock the age of the sign-in is measured with.private final FactorTimelineReads the factors of the session and when they were presented.private final HasConfirmedSecondFactorUseCaseTells whether the account has a confirmed second factor.private final MfaPropertiesMulti-factor settings, with the maximum age of the sign-in. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanTells whether a sign-in is recent enough.booleanisSatisfied(UUID userId, org.springframework.security.core.Authentication authentication) Tells whether the session may make a sensitive change to the account.
-
Field Details
-
hasConfirmedSecondFactorUseCase
Tells whether the account has a confirmed second factor. -
factorTimeline
Reads the factors of the session and when they were presented. -
mfaProperties
Multi-factor settings, with the maximum age of the sign-in. -
clock
Clock the age of the sign-in is measured with.
-
-
Constructor Details
-
PhoneSessionStepUp
public PhoneSessionStepUp()
-
-
Method Details
-
isSatisfied
public boolean isSatisfied(UUID userId, org.springframework.security.core.Authentication authentication) Tells whether the session may make a sensitive change to the account.- Parameters:
userId- identifier of the account.authentication- the authentication of the session.- Returns:
truewhen the account has no confirmed second factor, or the session is multi-factor and its sign-in is recent enough.
-
isRecent
Tells whether a sign-in is recent enough.- Parameters:
authTime- instant of the sign-in.- Returns:
truewhen it is not in the future and at most the maximum age old.
-