feat(auth): add two-factor authentication #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/two-factor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
feat/email-verification); last of the three auth changes (OIDC, email verification, 2FA / WebAuthn). New dependencies, as approved:nimble_totp,wax_(withcbor,x509,asn1_compiler) andeqrcode.Changes
UserAuth.log_in_user(the one place all sign-in paths end: password, OIDC) now only makes the login wait in the signed session for/users/two-factor; the waiting state grants nothing, andstart_session/3is the only thing that makes a session after it. Audit of session creation: password and OIDC (gated), the second-factor controller (verified), password change (sudo mode, see below), and token reissue (an already valid session).none, signature counter that goes backwards refused, 10 keys per user./users/settings/two-factor(sudo mode): QR code, key, keys list, recovery codes; the login page gets the code form and a security-key button (assets/js/webauthn.js).wax_says it has not been independently reviewed.Verification
mix format --check-formatted,mix compile --warnings-as-errors,mix credo --strict,mix dialyzer: clean.mix test: 1311 passed on SQLite and on PostgreSQL. WebAuthn is tested against a software authenticator (ES256) that wrong-origin, wrong-host, wrong-challenge, wrong-signature, other-user, replayed and counter-regression cases are refused by.