TeamDesk Knowledge Base & Support

   Home      FAQ      Forum      Idea Exchange      Ask a Question      My Stuff      Help   
  
base64URLEncode to create JWT (json web token)
We would like to produce a JWT (Json web token, as described here: (https://jwt.io/).

Teamdesk's HMAC formula seems to work to produce the signature.
But the first 2 values (header and payload) are supposed to be base64URLEncoded.

e.g. this string: {"alg":"HS256","typ":"JWT"}
when base64URLEncoded (by this tool https://base64.guru/standards/base64url/encode) becomes:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9

Teamdesk's "Hash" formula includes base64 encoding, but it also requires an algorithm, and it does not produce a result matching the tools mentioned above. For example:

Hash('SHA2_256','{"alg":"HS256","typ":"JWT"}','base64')
yields
wIFCKcIBqxAiBwdB0V7aevIYnbZKLIhpnGSB27g1Ia8=

Is there another way to produce this dynamically from teamdesk? or should it be done externally?
thanks for any suggestions!
ID
1422
Category
Integration/API
Author

Kathryn Whitenton
Date Created
3/1/2021 12:05:50 PM
Date Updated
3/4/2021 5:49:38 PM
Comments
Kathryn Whitenton 3/4/2021 5:49:38 PM
Update: with Kirill's help we were able to find a workaround to
1. for static values, encode them once (we will use integromat for this)
2. for an expiration timestamp which must be updated, we will update periodically (using integromat). But we need only do this for one record and can pass that value to all other records. (This is possible even though the expiration is part of the same base64encoded payload as other values because, multiple base64encoded strings can be concatenated and still be valid as long as the original number of characters was divisible by 3.)
Feedback
Back to Search Results