New Ory Agent Security is now live! Claim your complimentary test drive. Get Started!

Skip to main content

Address verification

Address verification ensures that a user’s email or phone number is valid and belongs to them. It helps prevent spam, ensures delivery of important notifications, and maintains system integrity.

Ory supports these verification policies:

  • Require a verified address before password sign-in.
  • Allow optional verification. Users can choose to verify their email or phone number, but it’s not required or enforced by the UI.

Address verification must be enabled in your project (selfservice.flows.verification.enabled: true).

note

The method-specific actions below override global after hooks for the corresponding flow. Before enabling them through the Console or CLI, review trigger precedence.

The CLI commands add hooks. Only add a hook if it isn't already configured for that flow and method.

Require verification on login​

To require address verification at login, use the require_verified_address action. It requires at least one verified address for the identity. The Ory Console setting and Ory CLI example below apply to password sign-in.

  1. Go to Authentication → Account verification in the Ory Console.
  2. If verification is disabled, turn on Enable verification in the Settings card.
  3. Enable Require verification to sign in.
  4. Click Save changes.
note

If the identity schema defines multiple verifiable addresses, Ory sends a verification code to the first one and redirects the user to the verification flow.

If none of the identity's verifiable addresses are verified, a code will be sent to the first email or phone number in the list. If at least one address is verified, Ory will not ask for verification.

For HTML form submissions, the POST /self-service/login endpoint responds with an HTTP 303 redirect to the verification flow.

Legacy compatibility​

Before May 2025, require_verified_address returned a 400 error without sending a verification code. This behavior is deprecated. To re-enable it:

ory patch identity-config --project <project-id> --workspace <workspace-id> \
--add '/feature_flags/legacy_require_verified_login_error=true'

The verification and show_verification_ui actions in login flows (but not sign up!) are also deprecated. Use require_verified_address instead.

Verification on sign up​

You can let users verify later or require verification before password sign-in.

Optional verification​

Users sign up without address verification, but a code is sent. They can verify later. By default, Ory follows this behavior.

Required verification for password sign-up​

Users must verify their address before signing in with a password. After registration, they’re redirected to the verification flow.

note

If the identity schema includes multiple verifiable addresses, the code is sent to the first one.

To configure this in Ory Console:

  1. Go to Authentication → Account verification in the Ory Console.
  2. If verification is disabled, turn on Enable verification in the Settings card and click Save changes.
  3. Under Verification strategy, select One Time Password. The Post-registration card appears only for this strategy.
  4. In the Post-registration card, enable Email/password sign-up.
  5. Click Save changes in the Post-registration card.
  6. In the Settings card, enable Require verification to sign in and click Save changes. Users can then sign in with a password only after verifying their address.
  7. Go to Authentication → General in the Ory Console. In the Account access card, turn off Enable sign in after registration and click Save changes.
note

Email/password sign-up adds a registration hook for the password method. Global registration webhooks then no longer run for password sign-ups unless you also add them for the password method. See trigger precedence.

For browser clients using native forms, successful registration redirects to the verification flow with HTTP 303.

Show the verification screen after registration​

Ory Network automatically issues a session after successful registration with social sign-in, SAML, WebAuthn, passkeys, or a one-time code. Showing the verification screen doesn't prevent these users from receiving a session before verification. Require verification to sign in and Enable sign in after registration control password sign-in and password registration, respectively.

To show the screen after social sign-in or WebAuthn registration, first enable the corresponding sign-in methods:

  • For social sign-in, go to Authentication → Social Sign-In (OIDC) in the Ory Console, turn on Enable social sign-in, and click Save changes.
  • For WebAuthn, go to Authentication → Passwordless login in the Ory Console, turn on Enable WebAuthn passwordless authentication, and click Save changes.

Then configure the verification screen:

  1. Go to Authentication → Account verification in the Ory Console.
  2. If verification is disabled, turn on Enable verification in the Settings card and click Save changes.
  3. Under Verification strategy, select One Time Password. The Post-registration card appears only for this strategy.
  4. In the Post-registration card, enable Social sign-up (OIDC) or Passkey sign-up (WebAuthn). Each toggle appears only when its sign-in method is enabled.
  5. Click Save changes in the Post-registration card.
note

Each toggle adds a registration hook for its method. Global registration webhooks then no longer run for sign-ups with that method unless you also add them for the method. See trigger precedence.

The following CLI command enables the verification screen after password, social sign-in, and WebAuthn registration. To require verification before password sign-in, also disable automatic sign-in after registration and enable Require verification to sign in, as described in the password setup above.

ory patch identity-config --project "$PROJECT_ID" \
--add '/selfservice/flows/registration/after/password/hooks/-={"hook":"show_verification_ui"}' \
--add '/selfservice/flows/registration/after/oidc/hooks/-={"hook":"show_verification_ui"}' \
--add '/selfservice/flows/registration/after/webauthn/hooks/-={"hook":"show_verification_ui"}'

Legacy compatibility​

In projects created before May 2025, the registration response includes continue_with even if Post-registration > Email/password sign-up is off.

To re-enable this legacy behavior:

ory patch identity-config --project <project-id> --workspace <workspace-id> \
--add '/feature_flags/legacy_continue_with_verification_ui=true'

Verification on address change​

When a user updates their email address or phone number in the settings flow, Ory sends a verification code to the new address. By default, the settings flow will display a success message when the profile is updated, but the address remains unverified until the user completes the verification process.

tip

To require verification before the new address replaces the old one, use the verify_new_address action. Unlike show_verification_ui, it defers the change until the user verifies the new address.

Show verification screen after address change​

If you want users to be immediately redirected to verify their new address after changing it, you can configure the show_verification_ui hook for the settings flow. Your client can use the verification flow returned in the JSON response to redirect the user to the verification screen instead of showing a success message.

To enable this behavior, use the Ory CLI:

ory patch identity-config --project {project_id} \
--add '/selfservice/flows/settings/after/profile/hooks/-={"hook":"show_verification_ui"}'

For browser clients using native forms, Ory redirects to the settings flow's return URL with HTTP 303.