File tree Expand file tree Collapse file tree
issuer-rest/lib/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,6 +60,11 @@ describe('OID4VCIServer', () => {
6060 grants : {
6161 'urn:ietf:params:oauth:grant-type:pre-authorized_code' : {
6262 user_pin_required : true ,
63+ tx_code : {
64+ length : 6 ,
65+ input_mode : 'numeric' ,
66+ description : 'Please enter the 6 digit code you received on your phone' ,
67+ } ,
6368 'pre-authorized_code' : preAuthorizedCode1 ,
6469 } ,
6570 } ,
@@ -79,7 +84,6 @@ describe('OID4VCIServer', () => {
7984 'urn:ietf:params:oauth:grant-type:pre-authorized_code' : {
8085 ...credentialOfferState1 . credentialOffer . credential_offer ?. grants ?. [ 'urn:ietf:params:oauth:grant-type:pre-authorized_code' ] ,
8186 'pre-authorized_code' : preAuthorizedCode2 ,
82- user_pin_required : false ,
8387 } ,
8488 } ,
8589 } ,
@@ -185,7 +189,7 @@ describe('OID4VCIServer', () => {
185189 it ( 'should return http code 400 with message User pin is required' , async ( ) => {
186190 const res = await requests ( app )
187191 . post ( '/token' )
188- . send ( `grant_type=urn:ietf:params:oauth:grant-type:pre-authorized_code&pre-authorized_code=${ preAuthorizedCode1 } ` )
192+ . send ( `grant_type=urn:ietf:params:oauth:grant-type:pre-authorized_code&pre-authorized_code=${ preAuthorizedCode1 } &user_pin=12345678 ` )
189193 expect ( res . statusCode ) . toEqual ( 400 )
190194 const actual = JSON . parse ( res . text )
191195 expect ( actual ) . toEqual ( {
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ export const assertValidAccessTokenRequest = async (
110110 invalid_request:
111111 the Authorization Server does not expect a PIN in the pre-authorized flow but the client provides a PIN
112112 */
113- if ( ! credentialOfferSession . credentialOffer . credential_offer ?. grants ?. [ GrantTypes . PRE_AUTHORIZED_CODE ] ?. user_pin_required && request . user_pin ) {
113+ if ( ! credentialOfferSession . credentialOffer . credential_offer ?. grants ?. [ GrantTypes . PRE_AUTHORIZED_CODE ] ?. tx_code && request . user_pin ) {
114114 throw new TokenError ( 400 , TokenErrorResponse . invalid_request , USER_PIN_NOT_REQUIRED_ERROR )
115115 }
116116 /*
You can’t perform that action at this time.
0 commit comments