cancel
Showing results for 
Search instead for 
Did you mean: 

Receiving JWE error on Format

The process of obtaining the authorization token requires several steps of decoding, encoding, decrypting, and encrypting data. At the end you have a JWE (JSON Web Encryption) object you submit to Cybersource and they return the token we will use later to charge the credit card.

 

This is a sample JWE we are creating:

 

eyJraWQiOiIwOEFIUGU3WWtHYkszVG9mU01zd1J2V2NyU3F6M25xTiIsImVuYyI6IkEyNTZHQ00ifQ==.I3tlR4wsBLgZCQm7g7d04wxKjSDqvmyYsqpNJ7SBgCfDpAG9mbe3N1pP6vaFn5wob88FMva/recU3+RHEWLYzIOk3aXKoORaDLb9FHHkwDpf1I1CoH3JCCfTHg27cQjBifarmZoC73lNtYoZ

pdlq7nxzbr/fD9eu2xE/DHiOny9oAInv5VFEZuUPrRxOaBJ9i6zULYTDL6DRpnvvUfwuwHt6Nk4vHgvo31XSPz3INOWsvB9K/o3rkRepIsdFosDjI/MBaNbC41PuVCLt9S9AYtqLGnIaGXEGOZ1Rd7nSdDYlLL+XMIc5tWyElBrFx62XmuUQWKNxx2Of1Ibv+cAsNQ==.P3qvHeaEfN8G7Ka1.GBOsMT+

MHUPUfi51fhzuYlB06pLkBp2rmggGmEwavZrqMjYtzflvYT3AfeZgEQvIr4TpQ9ZdMyQVhykqUFjaz4gr7skYaF9CzJlefqmiK/MYWLgLhn4heDY65rjCft3pkLPUuXn4OKn4Ow0i3HA4F3fUE17KurkWfZ/YFU/lKj53lUzesDUM5orHEz+gzWpYv7rUn4aiCcJCR6619229+iJ2FV+1EHnit09DX+dN

kwYW0WJttd+oFavO+XjeQaUfUgWyD9eLoKneNVvHKbWUId2XUchLz5juPOXf4S7VmAnlqsgVTKDeXD3b2F5ZAEpMpK1y1xL+6CQN40MQQDO5xk08g7/bl14CCyX3LK8BeAGtMuZOIf6p66KTiS3/pHwPCN+BACJl2G0eqmB6k3yKShR1k1XiEWM8gK3GycVTIjvEZrp8Y3XWybJESEWEM8ilUHDND7cAO

4ExSR8nTwyCXZtPCBbI9sIEKgsG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4CSdpFIC/NsvAw+BaH65/PRggWwyuPqNUMMY

8FObEgw5NonKI7UI8PLuTO8YCqb/Oh454y6k3ZnGL4Q8z9d2qQyre0kU+coMxYWGZ0Lj7EzD07ndxwfoVzdm8k11bHT4nEd6D05sRiD8T9nmxElINRzFG8xCceYiB/fbmCnN92ugld3e1MCaAfbyRdo6qIw5fCQp+SCB7pL1F6HtwTHzHEuYpXbpU0nmfVyVIxpS4jSS5Hbcc0DeR1GEXpCEWKqQQ/ipq

9iQwxgghLHyVN3uJzAmEnB7pVol96PRNTv0sAy3vgcjEM00rgNnXoPTpBa3lvkx3khLxcHx0upIglgB/+J+UrUk/U3j6s0onPRxuLlBHcrYLGwv48tnQWWq1SuOC8VQ54f528xyMHQN/MK9qCnY2A63JGlyPCP9qsEC548DyQYQaxkQQY5AlD13uIgur8S/zPw7kwQ59nNBjZf3X9EKe7kFdZYA3sG+kk

FZkgTiwr279T1naoIBS1QJZRyhAJzurQ5IRSylGTW9wJrwsKYkuavxOiEd1KS7QLRxhlqReVD+VgAtyE5/1PTw/jo5O39d40EXdiOBhZwj00WhpkNfygSnlDw15xRlg4AiuLmY4WKKd/aTQKICr7Z7SL9sOGWLBX4G5YLBXLDNLezQMSAkfwZENOOgmBTdrBCwf6oe7Ssuoof9SKWXz0CHrX3n7iPdPvu

xHZMYh/5E15vmMAa4fZAAh2vlPQYZvwEDUcG2vmO72ZU9rm61/D8KlIP+9dd+qF2UoAeDvlvhf6.zUKY2PDpSYc9M+GSmkJgFA==

 

When we submit the JWE we receive this message in return:

 

{

  "correlationId": "df1eeb0a-b530-4189-825e-660111d0ae1e",

  "message": "Invalid JWE format",

  "reason": "VALIDATION_ERROR"

}

 

Cybersource asked for the [correlationId] so they could look in their system and tell us why it failed.

 

They looked in their system. Their answer was “It failed because of an invalid JWE format”. They couldn’t provide more detail. We (Vervint) do not know if “invalid format” means incorrect structure with correct data, or correct structure with incorrect data.

 

We have had several emails with them and have made some small tweaks based on their feedback. But still unable to get a success response.

 

Look closely at the encoded block of data above and you will notice a period here and there; there should be four. The periods separate the five components of the JWE. I am now trying to address each component individually with Cybersource in hopes we can find the problem.

 

To complicate the research, the JWE is different every time we run a test. That is by design, that is how encryption works. Encrypting the same data multiple times will yield different results. That makes troubleshooting more difficult.

 

AmyFoote
Member
0 REPLIES 0