File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
packages/oidc-mock-provider/src Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export interface TokenMetadata {
24
24
// parameters that are defined this way.
25
25
client_id : string ;
26
26
scope : string ;
27
+ nonce ?: string ;
27
28
}
28
29
29
30
export type MaybePromise < T > = T | PromiseLike < T > ;
@@ -205,6 +206,7 @@ export class OIDCMockProvider {
205
206
code_challenge,
206
207
code_challenge_method,
207
208
state,
209
+ nonce,
208
210
} = Object . fromEntries ( url . searchParams ) ;
209
211
if ( response_type !== 'code' ) {
210
212
throw new Error ( `unknown response_type ${ response_type } ` ) ;
@@ -216,6 +218,7 @@ export class OIDCMockProvider {
216
218
scope,
217
219
code_challenge,
218
220
code_challenge_method,
221
+ nonce,
219
222
} ) ,
220
223
state,
221
224
} ) . toString ( ) ;
@@ -235,6 +238,7 @@ export class OIDCMockProvider {
235
238
code_challenge,
236
239
code_challenge_method,
237
240
isDeviceCode,
241
+ nonce,
238
242
} = this . retrieveFromStorage ( device_code ?? code ) ;
239
243
240
244
if ( ! isDeviceCode ) {
@@ -267,6 +271,7 @@ export class OIDCMockProvider {
267
271
const { access_token, id_token, expires_in } = await this . issueToken ( {
268
272
client_id,
269
273
scope,
274
+ nonce,
270
275
} ) ;
271
276
272
277
// Issue a token response:
@@ -344,6 +349,7 @@ export class OIDCMockProvider {
344
349
scope : metadata . scope ,
345
350
iss : this . issuer ,
346
351
aud : metadata . client_id ,
352
+ nonce : metadata . nonce ,
347
353
...payload ,
348
354
} ;
349
355
const makeToken = ( payload : Record < string , unknown > ) => {
You can’t perform that action at this time.
0 commit comments