0

As the title suggests, I need to make a callout to an external service but must sign the request with a JWT token (using a private key).

Is this possible?

9
  • 1
    Does this answer your question? How to Generate Access Token Using Ampscript Commented Sep 14, 2020 at 13:47
  • No, this is to authenticate with MC API, whereas what I am asking is whether its possible to generate a JWT token in Marketing Cloud (for external apps) Commented Sep 14, 2020 at 13:48
  • Perhaps with the SHA256 function in a CloudPage. Commented Sep 14, 2020 at 13:52
  • @AdamSpriggs Am I right to assume SHA256 doesn't support private keys? I don't see any parameters to support this. Commented Sep 14, 2020 at 13:54
  • I don' think it does. You can upload keys for use with the EncryptSymmetric and DecryptSymmetric functions, but I'm not sure if that'll work for to generate a JWT key. Commented Sep 14, 2020 at 13:56

1 Answer 1

2

This is newly supported with the GetJWT function.

string GetJWT(string key, string algorithm, string jsonPayload) 

Example:

SET @JWT = GetJWT("0123456789abcdef0123456789abcdef", "HS256", @JSON) SET @HREF = CONCAT("https://someurl?sign=",@JWT) 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.