GetChallengeDataResponse
Package: @nauth-toolkit/client
Type: Interface
Response containing challenge-specific data returned by getChallengeData().
import { GetChallengeDataResponse } from '@nauth-toolkit/client';
Properties
| Property | Type | Required | Description |
|---|---|---|---|
challengeData | Record<string, unknown> | Yes | Challenge-specific data. Structure varies by method. |
Challenge Data by Method
| Method | Structure | Description |
|---|---|---|
| Passkey | WebAuthn assertion options | WebAuthn credential request options for verification |
| TOTP | Empty object or metadata | May contain retry information |
| SMS | { maskedPhone?: string } | Masked phone number for verification |
{ maskedEmail?: string } | Masked email for verification |
Examples
Passkey Challenge:
const challengeData = await client.getChallengeData(session, 'passkey');
// Use challengeData.challengeData with WebAuthn API
const credential = await navigator.credentials.get({
publicKey: challengeData.challengeData as PublicKeyCredentialRequestOptions,
});
Angular:
this.authService.getChallengeData(session, 'passkey').subscribe((response) => {
// Handle WebAuthn challenge
this.handlePasskeyChallenge(response.challengeData);
});
Related Types
ChallengeResponse- Challenge response unionAuthChallenge- Challenge types enumMFAMethod- MFA method types
Used By
- NAuthClient.getChallengeData() - Returns
GetChallengeDataResponse - Angular AuthService.getChallengeData() - Observable wrapper
- Challenge Handling Guide - Complete challenge flow guide