Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Refreshing jwt token daily

razvan_ulici
5 - Atom

Hello. I have a workflow where I pull some data from Adobe Analytics through a JSON request, but I also have some authentication credentials such as url, client id, client secret and jwt token. The problem is I have to refresh this workflow every single day and I would prefer to schedule it on alteryx server but I have to manually change the jwt token every day in order for the workflow to run (security reasons I think). Is there any way I could automatically refresh the jwt token daily too? The token is taken from Adobe Developer Console by using a private key.

Thank you!

4 REPLIES 4
PhilipMannering
16 - Nebula
16 - Nebula

There is a way, but it's not trivial. You would make a separate API request to get that JWT Token and then use that token in your next API request. So you're chaining requests together (two download tools).

 

The question is what that first API call looks like. You can usually find the URL for this API request by Inspecting the login page (using the Chrome Developer Tools) while logging in. Under the Network tab you should be able to see an API call being made to retrieve that token - the response will be the JWT token which you can use in subsequent API calls.

 

I hope this helps get you started. 

 

Thanks,

Philip 

PhilipMannering
16 - Nebula
16 - Nebula

One thing I forgot to mention is that you will need to use your login credentials in this first request. So that usually means saving your login username and password somewhere in the workflow for all to see, which isn't ideal.

 

If anybody has a good solution to this, I would like to know!

razvan_ulici
5 - Atom

Hey Philip, that sounds actually interesting. So you're saying I should put in another text input tool with the API request to get that JWT token (followed by download tool) and then use that JWT token in the flow?

So you get a better understanding of my workflow, I have a text input with an url, client secret, client id and JWT token that go through a download and parse tool. I also have a private key that I have to input on the Adobe Developer Console in order to manually get the new JWT Token that I have to manually change in the text input tool.

Thank you for the reply, I would really like to get this solved even if I have my credentials in the workflow which I know it's not optimal but good for now.

PhilipMannering
16 - Nebula
16 - Nebula

Hi @Raz.

 

"So you're saying I should put in another text input tool with the API request to get that JWT token (followed by download tool) and then use that JWT token in the flow?"

 

Yep, exactly.

 

So I'm guessing that when you use your browser to input the private key manually and generate a new JWT Token, your browser is making it's own API call behind the scenes. If you find out what that is (using the chrome developer tools) you should be able to replicate it in Alteryx.

 

 

Labels