Introduction

Meet AddAuth

Development 0.2.0.dev · Reviewed 2026-09-07

AddAuth extends the authentication code Rails generates, so you can add sign-in methods without replacing your account models.

Where it fits

Start with bin/rails generate authentication. Your app keeps its User, Session, account provisioning, and password-reset flow. AddAuth adds session handling and the sign-in features you enable.

The current development version supports password, email-link and passkey sign-in, session controls, reauthentication, recovery, and optional bot checks. You can use the included pages or customize their presentation.

Explore the features and roadmap, or compare authentication gems before choosing a starting point.

How sign-in works

Each method checks who the person is, then starts a session—the record that keeps their browser signed in. These diagrams describe the unreleased 0.2.0.dev development version; your app enables the methods it needs, and the account’s policy decides which are allowed.

Password: use the account you already have

Password sign-inEnter an email address and password. The app checks the password and whether the account may sign in. Accepted credentials start a session; a failed check leaves the browser signed out with a general error.
Password sign-inEnter an email address and password. The app checks the password and whether the account may sign in. Accepted credentials start a session; a failed check leaves the browser signed out with a general error.YesNoEnter email and passwordApp checks password andaccount policyChecks pass?Start a signed-in sessionStay signed out; show ageneral error
Password sign-inEnter an email address and password. The app checks the password and whether the account may sign in. Accepted credentials start a session; a failed check leaves the browser signed out with a general error.YesNoEnter email and passwordApp checks password andaccount policyChecks pass?Start a signed-in sessionStay signed out; show ageneral error

Scroll sideways on a small screen to read the full diagram.

View diagram source
Mermaidintro-password.mmd
flowchart TD
    accTitle: Password sign-in
    accDescr: Enter an email address and password. The app checks the password and whether the account may sign in. Accepted credentials start a session; a failed check leaves the browser signed out with a general error.
    A[Enter email and password] --> B[App checks password and account policy]
    B --> C{Checks pass?}
    C -->|Yes| D[Start a signed-in session]
    C -->|No| E[Stay signed out; show a general error]

AddAuth uses your app’s existing password check and adds its shared session handling. A wrong password, an unknown account, and an account that cannot sign in receive the same general error.

Email-link sign-inRequest a link for an existing, eligible account. Open the delivered email link and confirm in the app. AddAuth checks the link and account, uses the link once, and starts a session. An expired or used link requires a new request.
Email-link sign-inRequest a link for an existing, eligible account. Open the delivered email link and confirm in the app. AddAuth checks the link and account, uses the link once, and starts a session. An expired or used link requires a new request.YesNoRequest a sign-in emailApp emails an eligibleaccountOpen the link and confirmsign-inLink and account checkspass?Use the link once; start asessionStay signed out; request anew link
Email-link sign-inRequest a link for an existing, eligible account. Open the delivered email link and confirm in the app. AddAuth checks the link and account, uses the link once, and starts a session. An expired or used link requires a new request.YesNoRequest a sign-in emailApp emails an eligibleaccountOpen the link and confirmsign-inLink and account checkspass?Use the link once; start asessionStay signed out; request anew link

Scroll sideways on a small screen to read the full diagram.

View diagram source
Mermaidintro-email-link.mmd
flowchart TD
    accTitle: Email-link sign-in
    accDescr: Request a link for an existing, eligible account. Open the delivered email link and confirm in the app. AddAuth checks the link and account, uses the link once, and starts a session. An expired or used link requires a new request.
    A[Request a sign-in email] --> B[App emails an eligible account]
    B --> C[Open the link and confirm sign-in]
    C --> D{Link and account checks pass?}
    D -->|Yes| E[Use the link once; start a session]
    D -->|No| F[Stay signed out; request a new link]

The request screen does not reveal whether an account exists or an email was sent. Opening a link alone does not use it up; confirmation signs in the browser that submits it. See email-link sign-in for expiry, resending, and optional same-browser checks.

Passkey: approve with your device or security key

Passkey sign-inChoose a saved passkey and unlock it with your device or security key. The browser sends a signed response. AddAuth verifies it and the account before starting a session. A rejected response does not sign the person in.
Passkey sign-inChoose a saved passkey and unlock it with your device or security key. The browser sends a signed response. AddAuth verifies it and the account before starting a session. A rejected response does not sign the person in.YesNoChoose a saved passkeyUnlock with your device orsecurity keyBrowser sends a signedresponsePasskey and account checkspass?Start a signed-in sessionStay signed out
Passkey sign-inChoose a saved passkey and unlock it with your device or security key. The browser sends a signed response. AddAuth verifies it and the account before starting a session. A rejected response does not sign the person in.YesNoChoose a saved passkeyUnlock with your device orsecurity keyBrowser sends a signedresponsePasskey and account checkspass?Start a signed-in sessionStay signed out

Scroll sideways on a small screen to read the full diagram.

View diagram source
Mermaidintro-passkey.mmd
flowchart TD
    accTitle: Passkey sign-in
    accDescr: Choose a saved passkey and unlock it with your device or security key. The browser sends a signed response. AddAuth verifies it and the account before starting a session. A rejected response does not sign the person in.
    A[Choose a saved passkey] --> B[Unlock with your device or security key]
    B --> C[Browser sends a signed response]
    C --> D{Passkey and account checks pass?}
    D -->|Yes| E[Start a signed-in session]
    D -->|No| F[Stay signed out]

The browser handles the fingerprint, face, or PIN prompt; your app receives a signed response. A passkey must already be added to the account, and sign-in needs a supported browser with JavaScript. If it is unavailable or the person cancels, they can retry or use another method that their account permits.

Confirm identity before a sensitive action

Reauthentication, also called step-up, asks a signed-in person to verify again when a particular action needs it—for example, removing a passkey. The app checks both how recently they verified and whether the method is allowed for that action.

Reauthentication for a sensitive actionA signed-in person starts a sensitive action. If the app needs a fresh identity check, they verify with an allowed method and return to the confirmation page. When they submit, the app checks permission and verification again before making the change.
Reauthentication for a sensitive actionA signed-in person starts a sensitive action. If the app needs a fresh identity check, they verify with an allowed method and return to the confirmation page. When they submit, the app checks permission and verification again before making the change.NoVerifiedFailed or cancelledYesChecks passChecks failStart a sensitive actionFresh, allowed verificationexists?Verify with a permittedmethodReview the confirmation pageLeave the accountunchangedSubmit; app recheckspermission and verificationMake the requested change
Reauthentication for a sensitive actionA signed-in person starts a sensitive action. If the app needs a fresh identity check, they verify with an allowed method and return to the confirmation page. When they submit, the app checks permission and verification again before making the change.NoVerifiedFailed or cancelledYesChecks passChecks failStart a sensitive actionFresh, allowed verificationexists?Verify with a permittedmethodReview the confirmation pageLeave the accountunchangedSubmit; app recheckspermission and verificationMake the requested change

Scroll sideways on a small screen to read the full diagram.

View diagram source
Mermaidintro-step-up.mmd
flowchart TD
    accTitle: Reauthentication for a sensitive action
    accDescr: A signed-in person starts a sensitive action. If the app needs a fresh identity check, they verify with an allowed method and return to the confirmation page. When they submit, the app checks permission and verification again before making the change.
    A[Start a sensitive action] --> B{Fresh, allowed verification exists?}
    B -->|No| C[Verify with a permitted method]
    C -->|Verified| D[Review the confirmation page]
    C -->|Failed or cancelled| G[Leave the account unchanged]
    B -->|Yes| D
    D --> E[Submit; app rechecks permission and verification]
    E -->|Checks pass| F[Make the requested change]
    E -->|Checks fail| G

Only the permitted methods are offered: password, email link, or passkey. Some actions require a passkey; a recent password or email check cannot substitute for it. An email reauthentication link must be confirmed in the browser and session that requested it.

If verification is cancelled, fails, or expires before the final check, the change is not made. Reauthentication returns to a confirmation page; it does not automatically repeat the original action.

Choose a starting point

If you want to…Start here
Add password and email sign-inQuickstart
Keep password sign-in and upgrade sessionsSession adoption
Review your host’s deployment needsDeployment checklist
Use your app’s existing designStyling and views

What your app still owns

Your app creates accounts, decides which accounts may sign in, sends mail through its provider, and operates its database, cache and job queue. AddAuth does not add a registration flow or move passwords into a second account system.

If your login code differs substantially from the Rails generator, review the generated changes and exercise your existing controller hooks before adopting it. SQLite and PostgreSQL have implementation coverage; other databases need their own verification.

Check availability first

Install add_auth from RubyGems through your Rails app’s Gemfile. Version 0.2.0.dev is not yet published, so installation will be available after that release. Follow the quickstart for installation and app setup, and release status for availability and upgrade guidance.

Something unclear? Suggest a correction Release status

Search documentation

Type to find a guide.

Use Tab to move through results. Escape closes search.