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).
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.
- Ory Console
- Ory CLI
- Go to Authentication → Account verification in the Ory Console.
- If verification is disabled, turn on Enable verification in the Settings card.
- Enable Require verification to sign in.
- Click Save changes.
Run:
ory patch identity-config --project <project-id> --workspace <workspace-id> \
--add '/selfservice/flows/login/after/password/hooks/0={"hook":"require_verified_address"}'
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.
- Server rendered browser client
- SPA & Native clients
For HTML form submissions, the POST /self-service/login endpoint responds with an HTTP 303 redirect to the verification flow.
For AJAX (Accept: application/json) or native clients using /self-service/login/api, the endpoint responds with HTTP 403:
{
"error": {
"id": "session_verified_address_required",
"code": 400,
"status": "Bad Request",
"reason": "Your account's email or phone address are not verified yet. Please check your email or phone inbox or re-request verification.",
"details": {
"continue_with": [
{
"action": "show_verification_ui",
"flow": {
"id": "7f4dfb3b-c3cc-4e35-9f09-286b09e77beb",
"verifiable_address": "[email protected]",
"url": "https://<your-slug>.projects.oryapis.com/verification?flow=7f4dfb3b-c3cc-4e35-9f09-286b09e77beb"
}
}
]
},
"message": "your email or phone address is not yet verified"
}
}
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.
If the identity schema includes multiple verifiable addresses, the code is sent to the first one.
To configure this in Ory Console:
- Go to Authentication → Account verification in the Ory Console.
- If verification is disabled, turn on Enable verification in the Settings card and click Save changes.
- Under Verification strategy, select One Time Password. The Post-registration card appears only for this strategy.
- In the Post-registration card, enable Email/password sign-up.
- Click Save changes in the Post-registration card.
- 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.
- Go to Authentication → General in the Ory Console. In the Account access card, turn off Enable sign in after registration and click Save changes.
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.
- Server rendered browser client
- SPA & Native clients
For browser clients using native forms, successful registration redirects to the verification flow with HTTP 303.
The registration endpoint returns a 200 response with a continue_with field that contains the verification flow:
{
"identity": {
"id": "a7e27996-9bfa-4f19-8ec0-799c893b8e4c",
"traits": {
"email": "[email protected]"
}
},
"continue_with": [
{
"action": "show_verification_ui",
"flow": {
"id": "d859f6af-1dfe-453e-9320-d572e10edeea",
"verifiable_address": "[email protected]",
"url": "https://ory.example.org/verification?flow=d859f6af-1dfe-453e-9320-d572e10edeea"
}
}
]
}
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:
- Go to Authentication → Account verification in the Ory Console.
- If verification is disabled, turn on Enable verification in the Settings card and click Save changes.
- Under Verification strategy, select One Time Password. The Post-registration card appears only for this strategy.
- 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.
- Click Save changes in the Post-registration card.
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.
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"}'
- Server rendered browser client
- SPA & Native clients
For browser clients using native forms, Ory redirects to the settings flow's return URL with HTTP 303.
The settings endpoint returns a 200 response with the settings flow. Its continue_with field contains the verification flow:
{
"id": "...",
"ui": {
"action": "...",
"method": "...",
"nodes": [
/* ... */
]
},
"continue_with": [
{
"action": "show_verification_ui",
"flow": {
"id": "d859f6af-1dfe-453e-9320-d572e10edeea",
"verifiable_address": "[email protected]",
"url": "https://ory.example.org/verification?flow=d859f6af-1dfe-453e-9320-d572e10edeea"
}
}
]
}