Class PrimaryFactorSession

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

public class PrimaryFactorSession extends Object
Rules about the session a one-time token is used as a second factor in: it must already hold a primary factor, and the second factor must not be the very channel that signed the user in (an e-mail code after an e-mail sign-in would prove the same mailbox twice).
  • Field Details

  • Constructor Details

    • PrimaryFactorSession

      public PrimaryFactorSession()
  • Method Details

    • holdsPrimaryFactor

      public boolean holdsPrimaryFactor(org.springframework.security.core.Authentication authentication)
      Tells whether an authentication is a signed-in user who presented a primary factor.
      Parameters:
      authentication - the authentication, or null.
      Returns:
      true when it holds a factor of strength FactorStrength.PRIMARY or FactorStrength.PRIMARY_STRONG.
    • signedInThrough

      public boolean signedInThrough(org.springframework.security.core.Authentication authentication, OttChannel channel)
      Tells whether a channel is the one that signed the user in.
      Parameters:
      authentication - the authentication of the session.
      channel - the channel of the second factor.
      Returns:
      true when the authentication holds the sign-in authority of the channel.