AshAuthentication.Strategy.Totp.Plug (ash_authentication v5.0.0-rc.4)

Copy Markdown View Source

Plugs for the TOTP strategy.

Handles setup and sign-in for TOTP authentication.

Summary

Functions

Handle a TOTP confirm setup request

Handle a TOTP setup request

Handle a TOTP sign-in request

Handle a TOTP verification request for step-up authentication.

Functions

confirm_setup(conn, strategy)

Handle a TOTP confirm setup request

setup(conn, strategy)

Handle a TOTP setup request

sign_in(conn, strategy)

Handle a TOTP sign-in request

verify(conn, strategy)

Handle a TOTP verification request for step-up authentication.

This is used when an already-authenticated user needs to verify their TOTP code to access protected resources. The user is obtained from the connection's actor (set by authentication middleware).

On success, stores the verification result and marks TOTP as verified in the user's metadata.