Skip to main content

Class: ChallengeProcessor

Types.ChallengeProcessor

A server-side challenge processor. Compatible with node versions >= 18. Node runtimes < 18 require a Fetch API implementation to be provided.

Parse query string containing challenges and resolve them server side.

Constructors

constructor

new ChallengeProcessor(__namedParameters?)

Parameters

NameType
__namedParametersChallengeProcessorOptions

Methods

parseChallenges

parseChallenges(queryString): Promise<null | ChallengeSSR[]>

Input must be a query string containig either 'challenges' or 'sidcp' URL query parameters. Get a Promise that resolves to an array of challenge objects. Theses objects are either nonce or proxy challenges.

Parameters

NameType
queryStringstring

Returns

Promise<null | ChallengeSSR[]>


processChallenges

processChallenges(__namedParameters): Promise<string>

Process an array of challenges. The challenges must be either nonce or proxy challenges. Returns a Promise that resolves to a user token if the challenge resolution is successful.

Parameters

NameType
__namedParametersObject
__namedParameters.challengesChallengeSSR[]
__namedParameters.previousToken?string

Returns

Promise<string>