Skip to content
State machine (FSM) templates

State machine — auth session

Session auth state machine.

Template previewState machine (FSM)
Auth session lifecycle5 states · 5 transitions · 5 eventssubmit_credentials5_failed_attemptsmfa_verifiedtimeoutrefreshAnonymousPendingMFAAuthenticatedExpiredLocked1 thing is probably not what was meant; every transition names states that exist.WARN`PendingMFA`, `Authenticated` and `Expired` are not final, and no run that arrives at one of them can reach the final state: `PendingMFA`, `Authenticated` and `Expired` can still move, butevery path out of them comes back — a livelock, the cycle no run can leave. Drawn as boxes like every other box.OKAll 5 states are reachable from `Anonymous`.OKAll 5 transitions name states that exist, so every arrow in the figure is drawn.

Make it your own.

title "Auth session lifecycle"
state Anonymous
state PendingMFA
state Authenticated
state Expired
state Locked final
initial Anonymous
transition Anonymous -> PendingMFA on "submit_credentials"
transition Anonymous -> Locked on "5_failed_attempts"
transition PendingMFA -> Authenticated on "mfa_verified"
transition Authenticated -> Expired on "timeout"
transition Expired -> Authenticated on "refresh"