When Chaining Authentication Requests and using the Bearer Auth Method, Chained Request will contain "Bearer" string twice:
Chain Example:
Authorization in Response Header in format "Bearer The Second Request will have Bearer string twice since One will be added by Auth Method and the second one already exists in Authorization Response header.
I've tried setting Second Request's to {% filter replace("Bearer ", "") %}{% response 'header', 'req_81f8f8cb2aa147ef96ff3f88c593b322', 'Authorization' %}{% endfilter %} with no luck.
The only workaround I've found is that do not use built-in Auth Method(Set to No Authentication) and try setting the Header in Header Panel Manually.
Hmm, I tried that as well and it didn't work. However it did work with
{% filter replace('Bearer ', '') %}Bearer 12345{% endfilter %}
so I'm not sure what the problem is with using the response tag instead (I'll look into it).
I'm not sure if this will work for you, but a common way to do this sort of thing is to nest environment variables. If you set an environment variable to
{
"variable": "{% response 'header', 'req_123', 'Authorization' %}"
}
you can use it with regular variable syntax like
{{ my_variable | replace('Bearer ', '') }}
Tnx for the quick & helpful response, I'll try using env variables, tnx.
@gschier
It works well, Thank you very much
You're welcome 馃槃
Most helpful comment
Hmm, I tried that as well and it didn't work. However it did work with
so I'm not sure what the problem is with using the response tag instead (I'll look into it).
I'm not sure if this will work for you, but a common way to do this sort of thing is to nest environment variables. If you set an environment variable to
you can use it with regular variable syntax like