Skip to content

Fix incorrect JWT claim name for Response MLE KID#191

Open
AmitScriptsHub wants to merge 1 commit intoCyberSource:masterfrom
AmitScriptsHub:patch-1
Open

Fix incorrect JWT claim name for Response MLE KID#191
AmitScriptsHub wants to merge 1 commit intoCyberSource:masterfrom
AmitScriptsHub:patch-1

Conversation

@AmitScriptsHub
Copy link
Copy Markdown

The JWT token generated for Response MLE includes the claim name "v-c-response-mle-kid" but the CyberSource server expects "v-c-api-response-mle-kid". This mismatch causes the server to reset the connection (ECONNRESET) on POST requests when Response MLE is enabled.

File: src/authentication/jwt/JWTSigToken.js (line 57)
Change: "v-c-response-mle-kid" → "v-c-api-response-mle-kid"

Without this fix, any merchant enabling Response MLE with the Node SDK v0.0.75 will get ECONNRESET on all POST/PUT/PATCH requests (payments, refunds, etc). GET requests are unaffected as they don't include this claim.

Tested and confirmed working with:

  • PaymentsApi.createPayment (POST /pts/v2/payments)
  • MicroformIntegrationApi.generateCaptureContext (POST /microform/v2/sessions)
  • CustomerPaymentInstrumentApi.getCustomerPaymentInstrumentsList (GET)

The JWT token generated for Response MLE includes the claim name
"v-c-response-mle-kid" but the CyberSource server expects
"v-c-api-response-mle-kid". This mismatch causes the server to
reset the connection (ECONNRESET) on POST requests when Response
MLE is enabled.

File: src/authentication/jwt/JWTSigToken.js (line 57)
Change: "v-c-response-mle-kid" → "v-c-api-response-mle-kid"

Without this fix, any merchant enabling Response MLE with the
Node SDK v0.0.75 will get ECONNRESET on all POST/PUT/PATCH
requests (payments, refunds, etc). GET requests are unaffected
as they don't include this claim.

Tested and confirmed working with:
- PaymentsApi.createPayment (POST /pts/v2/payments)
- MicroformIntegrationApi.generateCaptureContext (POST /microform/v2/sessions)
- CustomerPaymentInstrumentApi.getCustomerPaymentInstrumentsList (GET)
@AmitScriptsHub
Copy link
Copy Markdown
Author

@aastgoel @sachshet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant