File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ export class AccessTokenClient {
104104
105105 if ( credentialOfferRequest ?. supportedFlows . includes ( AuthzFlowType . PRE_AUTHORIZED_CODE_FLOW ) ) {
106106 this . assertAlphanumericPin ( opts . pinMetadata , pin ) ;
107+ request . user_pin = pin ;
107108 request . tx_code = pin ;
108109
109110 request . grant_type = GrantTypes . PRE_AUTHORIZED_CODE ;
Original file line number Diff line number Diff line change @@ -102,12 +102,17 @@ export const assertValidAccessTokenRequest = async (
102102 invalid_request:
103103 the Authorization Server does not expect a PIN in the pre-authorized flow but the client provides a PIN
104104 */
105- if ( ! credentialOfferSession . credentialOffer . credential_offer ?. grants ?. [ GrantTypes . PRE_AUTHORIZED_CODE ] ?. tx_code && request . tx_code ) {
105+ if (
106+ ! credentialOfferSession . credentialOffer . credential_offer ?. grants ?. [ GrantTypes . PRE_AUTHORIZED_CODE ] ?. tx_code &&
107+ request . tx_code &&
108+ ! request . user_pin
109+ ) {
106110 // >= v13
107111 throw new TokenError ( 400 , TokenErrorResponse . invalid_request , USER_PIN_NOT_REQUIRED_ERROR )
108112 } else if (
109113 ! credentialOfferSession . credentialOffer . credential_offer ?. grants ?. [ GrantTypes . PRE_AUTHORIZED_CODE ] ?. user_pin_required &&
110- request . user_pin
114+ request . user_pin &&
115+ ! request . tx_code
111116 ) {
112117 // <= v12
113118 throw new TokenError ( 400 , TokenErrorResponse . invalid_request , USER_PIN_NOT_REQUIRED_ERROR )
You can’t perform that action at this time.
0 commit comments