Class PhoneSessionStepUp

java.lang.Object
com.irurueta.authserver.authorization.api.web.ott.PhoneSessionStepUp

@Component public class PhoneSessionStepUp extends Object
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 Details

    • hasConfirmedSecondFactorUseCase

      private final HasConfirmedSecondFactorUseCase hasConfirmedSecondFactorUseCase
      Tells whether the account has a confirmed second factor.
    • factorTimeline

      private final FactorTimeline factorTimeline
      Reads the factors of the session and when they were presented.
    • mfaProperties

      private final MfaProperties mfaProperties
      Multi-factor settings, with the maximum age of the sign-in.
    • clock

      private final Clock 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:
      true when the account has no confirmed second factor, or the session is multi-factor and its sign-in is recent enough.
    • isRecent

      private boolean isRecent(Instant authTime)
      Tells whether a sign-in is recent enough.
      Parameters:
      authTime - instant of the sign-in.
      Returns:
      true when it is not in the future and at most the maximum age old.