HMAC-SHA256 in Business Central AL

Dear Sir or Madam

I'm currently having troubles generating the correct HMAC-SHA256 value for the authorization header.

Using Microsoft's AL (Application Language) for Business Central, I try to recreate your example from the documentation.


1662642414037.png


Unfortunately, the result is:

zB9jBerPDKkVMJwKlZHbqDaKe3WS/eI+nvC4+JVzHIc= 


Even this free online tool generates a different value:1662643201870.png

Though I'm not sure if they interpret the Line Feed correctly.


Now my question is:

Am I missing something? How can every tool get different results?

Please let me know if you need more information.


Thanks in advance.

Best Answer

  • Hello @M.Kueblboeck, thanks for reaching out to us!

    I am not able to open up the documentation you have mentioned, but I am wondering if you are speaking about this one? World-Check One API HMAC Walkthrough July 2022.pdf

    Please let me know if this documentation is the same. If it is not - kindly go through it and it will hopefully guide you to creating the correct HMAC. Please do not hesitate to reach out if you have any more questions.


    Blessings,

    Judith

Answers

  • Hi,


    thanks for the fast response.

    I was speaking about a different documentation.


    Unfortunately, it is not possible to implement the correct calculation of the HMAC-value in Business Central so we switched to C#.


    This ticket therefore is closed.


    Thanks for your efforts.