Class UserMFA.StrongProgress
java.lang.Object
com.iizix.server.user.mfa.UserMFA.StrongProgress
- Enclosing class:
UserMFA
The progress of a sign-in held under a strong authentication policy (CC-SIGNIN-STRONG-POLICY, section 2.2 of the design of order 475): the policy, the target this client reaches, the factors verified so far, each at most once, and whether a recovery code was used - which counts as no factor and lets the user re-enroll a replacement (SA-D-10). And the second factors of the user OUTSIDE the policy's factors (CC-FIX-STRONG-FACTORS-NARROWED): the ones the sign-in is held for, when the user has enrolled none the policy allows, and whether one was proven - which counts as no factor either, and opens the enrollment of an allowed one. One instance lives with the held sign-in from the first factor to the completion, through every re-hold.
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StrongAuthPolicyThe policy the sign-in is held under.final booleanWhether this is the step-up of a signed-in session, not a sign-in.final intThe target: how many different factors the sign-in completes on this client.Constructor Summary
ConstructorsConstructorDescriptionStrongProgress(StrongAuthPolicy policy, int target, boolean stepUp, Set<String> verified) Constructs the progress.Method Summary
Modifier and TypeMethodDescriptionbooleanCounts a verified factor, once: a factor the policy does not allow counts nothing - it is remembered as proven (otherProven), what is no factor at all (a recovery code, null) is not.voidTells the second factors outside the policy's factors the sign-in is held for (CC-FIX-STRONG-FACTORS-NARROWED): the user has enrolled none of the factors the policy allows and has these, and proves one of them - asked as v5's rules ask it - before anything is enrolled.booleanisMet()Checks if the target is met: as many allowed factors as the target, every mandatory one among them.voidMarks that a recovery code was used: no factor, the sign-in waits for the enrollment of a replacement, which clears the mark when it counts.Gets the second factors outside the policy's factors the sign-in is held for.booleanChecks if a second factor outside the policy's factors was proven in this sign-in - or by its first factor, or by the recent sign-in of a session that steps up: no factor of the policy, it opens the enrollment of an allowed one.booleanrecovery()Checks if a recovery code was used.intGets how many factors are still to verify, the mandatory ones among them.toString()Gets the progress as it is written in a log.verified()Gets the factors verified so far.
Field Details
policy
The policy the sign-in is held under.target
public final int targetThe target: how many different factors the sign-in completes on this client.stepUp
public final boolean stepUpWhether this is the step-up of a signed-in session, not a sign-in.
Constructor Details
StrongProgress
Constructs the progress.- Parameters:
policy- The policy.target- The target, 1 or more.stepUp- Whether this is a step-up of a signed-in session.verified- The factors verified before the hold (a passkey that was the first factor; what a recent sign-in verified, for a step-up), null for none.- Throws:
NullPointerException- Ifpolicyis null.
Method Details
add
Counts a verified factor, once: a factor the policy does not allow counts nothing - it is remembered as proven (otherProven), what is no factor at all (a recovery code, null) is not. A factor that counts after a recovery code is the replacement the code led to: the recovery mark is done with.- Parameters:
factor- The factor, null for none.- Returns:
- true when it counted now.
markRecovery
public void markRecovery()Marks that a recovery code was used: no factor, the sign-in waits for the enrollment of a replacement, which clears the mark when it counts.recovery
public boolean recovery()Checks if a recovery code was used.- Returns:
- true when it was.
askOther
Tells the second factors outside the policy's factors the sign-in is held for (CC-FIX-STRONG-FACTORS-NARROWED): the user has enrolled none of the factors the policy allows and has these, and proves one of them - asked as v5's rules ask it - before anything is enrolled.- Parameters:
factors- The factors, null or empty when the sign-in is held for none of them.
otherAsked
otherProven
public boolean otherProven()Checks if a second factor outside the policy's factors was proven in this sign-in - or by its first factor, or by the recent sign-in of a session that steps up: no factor of the policy, it opens the enrollment of an allowed one.- Returns:
- true when one was.
verified
Gets the factors verified so far.- Returns:
- A copy, in the order of
StrongAuthPolicy.ALL_FACTORS; unmodifiable.
remaining
public int remaining()Gets how many factors are still to verify, the mandatory ones among them.- Returns:
- The count, 0 when the target is met.
isMet
public boolean isMet()Checks if the target is met: as many allowed factors as the target, every mandatory one among them.- Returns:
- true when met.
toString