- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I authenticate to Entra ID by using a certificate. I have created a rest message that uses this certificate to receive a token from entra id.
Now I have to use this token in Flow Designer to do an API call. How do I get the token in a flow action? I can't use REST step action because that one requires a credential, while the token is being saved in an oauth token record.
I'm trying to do a flow script step where I start the rest message through restMessage.execute(); but this returns the following error:
{
"Action Status": {
"code": 1,
"message": "Error: Error constructing REST Message/Method: <REST MESSAGE NAME>/Default GET,Detail: Error constructing REST Message/Method: APIM Azure Entra ID OAuth/Default GET"
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
why not use script in flow action to get the token and then return that token back to flow so that it can be used?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
why not use script in flow action to get the token and then return that token back to flow so that it can be used?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I don't know how to do that. Do you have a guide or documentation for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
refer below links on how to get token using script
OAuth2.0: Get new Access Token from existing Refresh Token
How to Setup OAuth2 authentication for outbound RESTMessageV2 integrations
OAuth : Script to Automate Token Request
How to generate the access token once it is expired from Business Rule?
How to get Auth Token using script when grant type is Authorization code
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thank you for the sources Ankur.
Is this the best practice to use Entra ID authentication in flows? I find it hard to believe that a common authentication method like entra id does not have any ootb integration steps in ServiceNow and Flow Designer.
