AuthChallengeDTO
Package: @nauth-toolkit/core
Type: DTO (Request/Response)
Data transfer objects for authentication challenges: response DTO and legacy completion request DTO.
- NestJS
- Express
- Fastify
import { AuthChallengeResponseDTO, ChallengeResponseRequestDTO, AuthChallenge } from '@nauth-toolkit/nestjs';
import { AuthChallengeResponseDTO, ChallengeResponseRequestDTO, AuthChallenge } from '@nauth-toolkit/core';
import { AuthChallengeResponseDTO, ChallengeResponseRequestDTO, AuthChallenge } from '@nauth-toolkit/core';
AuthChallengeResponseDTO
Challenge response DTO (primarily used in responses).
| Property | Type | Required | Description |
|---|---|---|---|
challengeName | AuthChallenge | Yes | Challenge type. Must be: VERIFY_EMAIL, VERIFY_PHONE, MFA_REQUIRED, MFA_SETUP_REQUIRED, FORCE_CHANGE_PASSWORD. |
session | string | Yes | Challenge session token. UUID v4 format. Trimmed and lowercased. |
challengeParameters | Record<string, unknown> | Yes | Challenge-specific parameters object. |
sub | string | Yes | User identifier. UUID v4 format. Trimmed and lowercased. |
ChallengeResponseRequestDTO
Legacy challenge completion request DTO (kept for backwards compatibility).
| Property | Type | Required | Description |
|---|---|---|---|
session | string | Yes | Challenge session token. UUID v4 format. Trimmed and lowercased. |
challengeName | AuthChallenge | Yes | Challenge type enum value. |
challengeResponses | Record<string, unknown> | Yes | Challenge-specific responses object. |
AuthChallenge enum
Represents the challenge type returned by the auth flow.
VERIFY_EMAILVERIFY_PHONEMFA_REQUIREDMFA_SETUP_REQUIREDFORCE_CHANGE_PASSWORD
Example
Challenge Response:
{
"challengeName": "VERIFY_EMAIL",
"session": "a21b654c-2746-4168-acee-c175083a65cd",
"challengeParameters": {
"email": "user@example.com"
},
"sub": "b32c765d-3857-5279-bdff-d286194b76de"
}
Used By
- AuthService.respondToChallenge() - Uses RespondChallengeDTO (not these legacy DTOs)