Class PrimaryFactorSession
java.lang.Object
com.irurueta.authserver.authorization.api.web.ott.PrimaryFactorSession
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final AuthenticationFactorRegistryRegistry that tells the strength of each factor authority. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanholdsPrimaryFactor(org.springframework.security.core.Authentication authentication) Tells whether an authentication is a signed-in user who presented a primary factor.booleansignedInThrough(org.springframework.security.core.Authentication authentication, OttChannel channel) Tells whether a channel is the one that signed the user in.
-
Field Details
-
factorRegistry
Registry that tells the strength of each factor authority.
-
-
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, ornull.- Returns:
truewhen it holds a factor of strengthFactorStrength.PRIMARYorFactorStrength.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:
truewhen the authentication holds the sign-in authority of the channel.
-