0

We are using MicroSoft Access 2016 32-bit VBA to call DocuSIgn API for generating and sending envelopes, and reading DocuSign data. We are trying to convert from DocuSign's legacy authentication to OAuth2. We do not have the option at this time to change to another application.

I am stuck on generating the JWT. I have successfully used JWT.IO to manually generate a JWT with the proper Header, Body, and Signature. I cannot figure out how to generate it programmatically in VBA. I have seen some code on GitHub but not sure how to implement it.

Are there libraries in VBA reference I need to include?

Can anyone point me in the right direction to get JWT in VBA?

Thank you.

PSD
  • 63
  • 8
  • See this StackOverflow question and answer https://stackoverflow.com/questions/69572758/create-a-jwt-in-vba-rsasha256 – Larry K Aug 16 '22 at 19:18
  • @LarryK, thank you. I saw that but I don't understand how to implement it or modify it for RS256. I understand that I would create a module and call the Compute Hash function, but that needs to be modified to handle the RS256 so I can pass in the Header, Body, and Signature. Also, it references System.Security.Cryptography, is that automatically available to Access VBA or is it a reference I have to set? I looked at the references and did find System, but not sure if that is what I need. I will create the module and see if I get errors because a reference isn't set. – PSD Aug 16 '22 at 20:20
  • PSD, is it possible to add a reference to any dll from VBA? That would make this much easier – Inbar Gazit Aug 17 '22 at 16:02

1 Answers1

1

DocuSign support finally gave me the alternative to use Authorization Code Grant with an extended refresh token. So much easier!

I did try using Koen Rijinsent's https://gist.github.com/krijnsent/7a90db8567504aa89a448132796792b3 that he provided via email, in addition to his ModHash. I was almost there, but his hash does not support RSASHA256. Thank you Koen for your efforts to help me.

PSD
  • 63
  • 8