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
| Name | Type |
|---|---|
__namedParameters | ChallengeProcessorOptions |
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
| Name | Type |
|---|---|
queryString | string |
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
| Name | Type |
|---|---|
__namedParameters | Object |
__namedParameters.challenges | ChallengeSSR[] |
__namedParameters.previousToken? | string |
Returns
Promise<string>