Docs

Verify a challenge proof

POST
/auth_attempts/{attempt_id}/challenges/{challenge_id}/verify

Verifies a challenge by submitting its proof: the credential, code or assertion for the factor.

The proof format depends on the challenge method. For example:

  • password method: { password: "…" }
  • totp method: { totp: { code: "123456" } }
  • passkey method: { passkey: { assertion: "…" } }
  • recovery_code method: { recovery_code: "…" }

On success, the factor is recorded on the authentication attempt. The attempt moves to the next pending challenge, or completes when every required factor is verified. Then call createAuthAttemptHandoff (POST /auth_attempts/{attempt_id}/handoff).

A 409 with att.proof_rejected means the proof was wrong. Check it and try again. There is no retry limit: you can retry until the attempt expires.

Authorization

oauth2 auth_attempt.write
headerAuthorizationBearer <token>

Scope: auth_attempt.write

Path Parameters

attempt_id*string

The attempt_id that createAuthAttempt (POST /auth_attempts) returns.

Match^att_[a-zA-Z0-9_-]+$
challenge_id*string

The challenge_id that createAuthAttemptChallenge (POST /auth_attempts/{attempt_id}/challenges) returns.

Match^ch_[a-zA-Z0-9_-]+$

Header Parameters

Idempotency-Key?string

Optional retry key for safe retries of the verification request. If a request with the same key has already been processed, the original response is returned. This prevents the same proof from being processed twice after a network issue or client retry.

Request Body

application/json
  1. body

The proof for an identifier challenge: the login name of the user.

The login name is resolved against the designated identifier (x-identifier) of every user schema in the project, and must identify exactly one user. A login name that matches none, or users of more than one schema, rejects the proof. The caller does not name the property: the project decides which property identifies users, in its user schemas.

login_name*string

The value being identified, as the user typed it.

Response Body

The proof was verified and the factor is recorded on the authentication attempt. A session is created from it only when the sign-in completes.

application/json
  1. response

The current state of an authentication attempt.

An authentication attempt is one sign-in round, and it expires 15 minutes after creation. It accepts factor challenges, verifies proofs and completes into a handoff token. Clients drive the attempt by:

  1. Issuing challenges: POST /auth_attempts/{attempt_id}/challenges
  2. Verifying proofs: POST /auth_attempts/{attempt_id}/challenges/{challenge_id}/verify
  3. Completing: POST /auth_attempts/{attempt_id}/handoff
attempt_id*attempt-id

The unique identifier of this authentication attempt, an opaque string with an att_ prefix.

Match^att_[a-zA-Z0-9_-]+$
project_id*project-id
Match^[a-zA-Z0-9_-]+$
state*string

Overall state of the authentication attempt:

  • in_progress: factors are still being collected; continue issuing challenges.
  • completed: all required factors have been verified; the attempt is ready for handoff.
  • failed: the attempt has failed, for example after too many failed proofs, and cannot be continued.
  • expired: the attempt's 15-minute lifetime has passed.
Value in"in_progress""completed""failed""expired"
session_id?|

The session being authenticated into. Either newly created or passed in on POST. For step-up authentication, this is the existing session_id provided on creation.

user_id?|

The user ID, if known at this point in the flow. Null until an identifier challenge has been verified.

required_factors?array<>

The authentication factor methods that the project policy requires to complete this attempt. The server computes them from the project's authentication policy. Use them to decide which challenges still need to be issued.

completed_factors?array<>

The factors verified in this attempt so far. Each item includes method-specific metadata in the payload field.

The server uses the verified_at timestamps to enforce time-based policies. One example is requiring a password verified within the last 5 minutes for step-up authentication to reach sensitive operations.

A factor appears here once its challenge reaches verified state.

challenges?array<>

All challenges issued within this attempt, in creation order. Use them to track the state of each factor challenge: pending, verified, failed or expired.

expires_at?string

When this attempt expires, 15 minutes after creation.

Formatdate-time
created_at*string

When this attempt was created.

Formatdate-time
Example Request
import { createZitadelApi, ZitadelClient } from "@zitadel/api/client";const api = createZitadelApi(  new ZitadelClient({    baseUrl: process.env.ZITADEL_URL ?? "http://localhost:8080",    token: process.env.ZITADEL_PROJECT_SECRET!, // server-side only  }),);const authAttemptChallenge = await api.verifyAuthAttemptChallenge(  "att_01J0Z9KX7Y0Q2Y7JX5M9K2YF3C",  "ch_01J0Z9KX7Y0Q2Y7JX5M9K2YF3C",  { login_name: "string" },);
Example Response
{  "attempt_id": "string",  "project_id": "string",  "state": "in_progress",  "session_id": "string",  "user_id": "string",  "required_factors": [    "identifier"  ],  "completed_factors": [    {      "method": "identifier",      "verified_at": "2019-08-24T14:15:22Z",      "payload": {        "method": "identifier",        "user_id": "string"      }    }  ],  "challenges": [    {      "challenge_id": "string",      "method": "identifier",      "state": "pending",      "created_at": "2019-08-24T14:15:22Z",      "expires_at": "2019-08-24T14:15:22Z",      "payload": {}    }  ],  "expires_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z"}

Was this helpful?