Authaz logoAuthaz
DocumentationAPI Reference
  • Get Started

    • Authaz
    • Core Concepts
    • Set up your app
    • Quickstart — cURL
  • Authentication

    • Authentication Settings
    • Signup
    • Invitations
    • Password Authentication
    • Multi-Factor Auth
    • Magic Link
    • OAuth / Social Login
    • Passkey (WebAuthn)
    • SAML SSO
    • Machine-to-Machine (M2M)
    • API Keys
  • Authorization

    • Authorization
    • Resources
    • Policies
    • Roles
    • Access Explorer
  • Tenancy

    • Multi-tenancy
    • Tenancy Customization
  • Brand & Host

    • Branding
    • Custom Domains
    • Communications & Email Templates
  • Operate

    • Users
    • Analytics
    • Audit Logs
    • Application Settings
  • SDK Quickstarts

    • Quickstart — Next.js
    • Quickstart — React SPA
    • Quickstart — Hono
    • Quickstart — .NET (Authaz.Sdk)
  • Recipes

    • Recipes & Cookbook
    • Next.js — first integration
    • Next.js — B2B SaaS (multi-tenant)
    • Hono — first integration
    • Hono — B2B SaaS (multi-tenant)
    • React SPA — first integration
    • React SPA — B2B SaaS (multi-tenant)
    • .NET — first integration
    • .NET — B2B SaaS (multi-tenant)
  • Reference

    • Tokens
    • API Reference
    • Errors & Troubleshooting
  • Documentation

    • How Authaz is Built
  1. Authaz
  2. Docs
  3. Authentication
  4. Password Authentication

Authentication

Password Authentication

4 min read·Updated Jun 19, 2026

Email + password is the default sign-in method. It's enabled the moment you create an application — no extra configuration required to ship a working login flow.

Use it in your app. Email + password is on by default — no integration step needed. The standard sign-in flow (Next.js · React · Hono · cURL) handles it. Your app code doesn't change when you tighten the policy or enable MFA below.

# A user signs up via Authaz Sign-In — no API call needed from your side.
# Optionally, configure the policy programmatically:
curl -X PUT https://your-app.authaz.io/api/v1/applications/{appId}/auth/password \
  -H "X-API-Key: $AUTHAZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "policy": {
      "minLength": 12,
      "requireUppercase": true,
      "requireNumber": true,
      "requireSymbol": false


Previous
Invitations
Next
Multi-Factor Auth
},
"mfaRequirement": "optional"
}'

Configuration#

Open Dashboard → Application → Authentication → Password, or call the policy endpoint above.

Whether this config is shared across every tenant or scoped per tenant is controlled by the Isolated Auth Stack switch on Settings → General → Tenant Customization. With Shared auth (default), one password policy applies to every tenant. With Isolated auth, the Authentication tab shows a tenant picker and each tenant gets its own policy. See Tenancy Customization.

SettingWhat it controls
Policy typePick a preset (good, excellent, fair) or custom. Presets are recalibrated against current best practice; custom exposes every knob below.
Minimum lengthDefault 12. Below 8 is rejected outright.
Maximum lengthDefault 128. Set high enough to allow passphrases; lower only if a downstream system truly can't handle longer values.
Require uppercase / lowercase / numbers / special charactersPer-class booleans. Composability is friendlier than mandating all four.
Check password breachValidates against the HaveIBeenPwned k-anonymity API. Only the first 5 hex characters of the SHA-1 hash leave your infrastructure.
Password history countHow many previous passwords are remembered to prevent re-use. Default 5. 0 disables history.
Password reset token expiryHow long a reset code remains valid (minutes). Default 60.
Require old password on resetWhen true, the reset flow asks for the current password too — useful when the "forgot password" entrypoint is misused as a password change. Default false.
MFA requirementdisabled, optional (user opts in), or required (cannot sign in without it). See the MFA page for the full enforcement options.
Account lockoutFailed-attempt threshold and lockout duration. Defaults: 5 attempts → locked for 15 minutes.
Session policyIdle timeout, max session duration, concurrent-session limit. Configured in Authentication Settings.
SignupOpen, invitation-only, or domain-allowlist. Configured on the Signup page.

Any setting changed in the dashboard is reflected immediately — no redeploy.

MFA (TOTP)#

When MFA is required or the user opts in, they register a TOTP authenticator (Google Authenticator, 1Password, Authy, etc.) on their first signed-in visit:

  1. Authaz shows a QR code and a base-32 secret.
  2. The user scans it and enters the rolling 6-digit code to confirm.
  3. Authaz issues a set of emergency recovery codes — show the user once, never again.

On every subsequent login, Authaz Sign-In prompts for the TOTP code after the password step. Recovery codes work as a backup.

Reset MFA for a user (e.g. they lost their phone):

curl -X POST https://your-app.authaz.io/api/v1/users/{userId}/mfa/reset \
  -H "X-API-Key: $AUTHAZ_API_KEY"

The user is forced to re-enroll on next login.

Password reset#

The flow is fully hosted — your app never sees a plaintext password. Authaz Sign-In owns it end-to-end:

  1. User clicks Forgot password on the login page.
  2. They enter their email; Authaz sends a reset code.
  3. They enter the code on the reset page; Authaz lets them set a new password (which must satisfy the active policy).

You can also kick this off from your backend:

curl -X POST https://your-app.authaz.io/auth/password/forgot-password \
  -H "Content-Type: application/json" \
  -d '{
    "applicationId": "app_01h...",
    "email": "user@example.com"
  }'

The response is intentionally 200 OK whether or not the email exists — leaking that information is an enumeration vulnerability.

Account lockout#

When a user fails too many login attempts in a row, they're locked out for the configured window. Authaz returns:

{ "error": "account_locked", "retryAfter": 900 }

retryAfter is in seconds. To unlock manually (e.g. after verifying identity through support):

curl -X POST https://your-app.authaz.io/api/v1/users/{userId}/unlock \
  -H "X-API-Key: $AUTHAZ_API_KEY"

Breach detection#

If you enable breach detection in the policy, every signup and password reset is checked against the HaveIBeenPwned k-anonymity API. Authaz only sends the first 5 hex characters of the SHA-1 hash, so the plaintext never leaves your infrastructure. Compromised passwords are rejected with:

{ "error": "password_breached", "message": "This password has appeared in a known data breach." }

Inviting users (no self-signup)#

When signup is invitation-only, you create users by sending an invitation:

curl -X POST https://your-app.authaz.io/api/v1/invitations \
  -H "X-API-Key: $AUTHAZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "newhire@yourcompany.com",
    "roleIds": ["role_member"]
  }'

The user receives an email with a one-time link, sets their password on Authaz Sign-In, and is automatically assigned the listed roles.

Suspending and re-activating users#

# Block sign-in (does not delete data)
curl -X POST https://your-app.authaz.io/api/v1/users/{userId}/suspend \
  -H "X-API-Key: $AUTHAZ_API_KEY"
 
# Allow sign-in again
curl -X POST https://your-app.authaz.io/api/v1/users/{userId}/activate \
  -H "X-API-Key: $AUTHAZ_API_KEY"
 
# Force logout from every device, immediately
curl -X POST https://your-app.authaz.io/api/v1/users/{userId}/sessions/revoke \
  -H "X-API-Key: $AUTHAZ_API_KEY"

Suspended users can no longer sign in or refresh tokens; existing sessions remain valid until their access tokens expire (default 15 min). Pair with sessions/revoke if you need an immediate logout.

Next steps#

  • Magic Link — passwordless, often paired with password as a backup.
  • Passkey — phishing-resistant, replaces password for many users.
  • cURL quickstart — see a password sign-in end-to-end.