Skip to main content

GetChallengeDataResponse

Package: @nauth-toolkit/client Type: Interface

Response containing challenge-specific data returned by getChallengeData().

import { GetChallengeDataResponse } from '@nauth-toolkit/client';

Properties

PropertyTypeRequiredDescription
challengeDataRecord<string, unknown>YesChallenge-specific data. Structure varies by method.

Challenge Data by Method

MethodStructureDescription
PasskeyWebAuthn assertion optionsWebAuthn credential request options for verification
TOTPEmpty object or metadataMay contain retry information
SMS{ maskedPhone?: string }Masked phone number for verification
Email{ 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);
});

Used By