Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

Flow Designer - REST Step | how to pass a token from script step to the REST Step.

Meloper
Kilo Sage

Hi, due to different requirements on the body I need to query the token in a script step before the rest step.
The token I get is currently still in the log.
Now I have problems to pass the token to the rest step.
The token uses a connection alias and in my opinion expects the token in the oauth_credential table.

For example, if I request the token manually via the UI action ‘get Oauth Token’. The token is stored in the oauth_credential table and the REST step then accesses this token.

How do I do this in a script step for the REST step?
How do I transfer the token?

Meloper_0-1751878787244.png

 

7 REPLIES 7

@Meloper 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Hi its was helpful 🙂 and i marked it already as this

ChandC
Tera Contributor

Don't write to the oauth_credential table by hand — that's the platform's job, and fighting it is where tokens go to die in logs (rotate that token, by the way — it's in your log now).

 

Two clean paths. Path one, the right one 90% of the time: skip the script step entirely and let the REST step's Connection & Credential alias handle OAuth. If the token endpoint is standard, configure the OAuth entity once and the step acquires and refreshes the token itself.

 

Path two, when you genuinely need a pre-fetched token (custom grant, non-standard body): have your script step return the token as a data output, then reference it in the REST step's Authorization header directly (Bearer ${token}) with the step's auth set to none. You own the token lifecycle then — including refresh.

 

The middle ground — half alias, half manual — is what breaks. Pick a lane.