@@ -260,9 +260,10 @@ export class OpenID4VCIClientV1_0_11 {
260260 authorizationResponse ?: string | AuthorizationResponse ; // Pass in an auth response, either as URI/redirect, or object
261261 code ?: string ; // Directly pass in a code from an auth response
262262 redirectUri ?: string ;
263+ additionalRequestParams ?: Record < string , any > ;
263264 asOpts ?: AuthorizationServerOpts ;
264265 } ) : Promise < AccessTokenResponse > {
265- const { pin, clientId } = opts ?? { } ;
266+ const { pin, clientId = this . _state . clientId ?? this . _state . authorizationRequestOpts ?. clientId } = opts ?? { } ;
266267 let { redirectUri } = opts ?? { } ;
267268 if ( opts ?. authorizationResponse ) {
268269 this . _state . authorizationCodeResponse = { ...toAuthorizationResponsePayload ( opts . authorizationResponse ) } ;
@@ -294,7 +295,7 @@ export class OpenID4VCIClientV1_0_11 {
294295 const kid = asOpts . clientOpts ?. kid ?? this . _state . kid ?? this . _state . authorizationRequestOpts ?. requestObjectOpts ?. kid ;
295296 const clientAssertionType =
296297 asOpts . clientOpts ?. clientAssertionType ??
297- ( kid && clientId && typeof asOpts . clientOpts ?. signCallbacks === 'function'
298+ ( kid && clientId && typeof asOpts . clientOpts ?. signCallbacks ?. signCallback === 'function'
298299 ? 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'
299300 : undefined ) ;
300301 if ( this . isEBSI ( ) || ( clientId && kid ) ) {
@@ -319,6 +320,7 @@ export class OpenID4VCIClientV1_0_11 {
319320 code,
320321 redirectUri,
321322 asOpts,
323+ ...( opts ?. additionalRequestParams && { additionalParams : opts . additionalRequestParams } ) ,
322324 } ) ;
323325
324326 if ( response . errorBody ) {
0 commit comments