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 {
2424 // parameters that are defined this way.
2525 client_id : string ;
2626 scope : string ;
27+ nonce ?: string ;
2728}
2829
2930export type MaybePromise < T > = T | PromiseLike < T > ;
@@ -205,6 +206,7 @@ export class OIDCMockProvider {
205206 code_challenge,
206207 code_challenge_method,
207208 state,
209+ nonce,
208210 } = Object . fromEntries ( url . searchParams ) ;
209211 if ( response_type !== 'code' ) {
210212 throw new Error ( `unknown response_type ${ response_type } ` ) ;
@@ -216,6 +218,7 @@ export class OIDCMockProvider {
216218 scope,
217219 code_challenge,
218220 code_challenge_method,
221+ nonce,
219222 } ) ,
220223 state,
221224 } ) . toString ( ) ;
@@ -235,6 +238,7 @@ export class OIDCMockProvider {
235238 code_challenge,
236239 code_challenge_method,
237240 isDeviceCode,
241+ nonce,
238242 } = this . retrieveFromStorage ( device_code ?? code ) ;
239243
240244 if ( ! isDeviceCode ) {
@@ -267,6 +271,7 @@ export class OIDCMockProvider {
267271 const { access_token, id_token, expires_in } = await this . issueToken ( {
268272 client_id,
269273 scope,
274+ nonce,
270275 } ) ;
271276
272277 // Issue a token response:
@@ -344,6 +349,7 @@ export class OIDCMockProvider {
344349 scope : metadata . scope ,
345350 iss : this . issuer ,
346351 aud : metadata . client_id ,
352+ nonce : metadata . nonce ,
347353 ...payload ,
348354 } ;
349355 const makeToken = ( payload : Record < string , unknown > ) => {
You can’t perform that action at this time.
0 commit comments