Clear authorization header on rest call redirect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday - last edited Tuesday
Hello,
I am calling a third party API get method that redirect to AWS API.
My call is done using REST step in a Flow and ends with this error: <Error><Code>InvalidArgument</Code><Message>Only one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified</Message>
If I use Postman with the same request, it works because they have a default setting Follow Authorization header (Retain authorization header when a redirect happens to a different hostname.) that is set to OFF by default. If I set it to ON, I get the same error I get in ServiceNow.
Meaning, I need to delete the Authorization header at the time of the redirect. But I am not able to find anything in ServiceNow that would do that, even by using a Script step in my Flow and calling sn_ws.RESTMessageV2().
Does someone has a clue on how to solve that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Can you try this
Run a probe that hits the third-party API, captures the Location header from the 302, then issues a second curl to that URL with no Authorization, and returns the body to your Flow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Thanks @Naveen20 , that sounds promising solution. However, what do you mean by "Run a probe"? What should I do? If I call the API ServiceNow does the redirect automatically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
That should do
