earvs0527
(Earlvil Jan Abubo)
1
Hi,
Good day! I’m having an issue inside my loop where I can’t get the bearer token outside of it on http request.
request failed (type: HTTP Response Returned a Client Error, retryable: false): request failed: 401 - 401 Unauthorized - {"error":"JWT is required"}"
My request header is Authorization {{$.httprequest.body.BearerToken}}
at the top http request will show the output of {{$.httprequest.body.BearerToken}} like Bearer 123…
Can you try passing $ in the loop context and use {{$.loop.context.httprequest.body.BearerToken}}.
earvs0527
(Earlvil Jan Abubo)
3
Hello,
It’s not working. I tried {{$.loop.context.httprequest.body.BearerToken}}
my loop input is
$.hTTPRequest1.body[0].access[?(@.type == “ENTITLEMENT” && @.source.name == “my source”")]
vsingathi
(Viswanath Singathi)
4
Your Authorization should be as below:
Authorization Bearer {{$.httprequest.body.BearerToken}}

Can you share your workflow json?
What is the loop context ?
earvs0527
(Earlvil Jan Abubo)
7
Hi,
I was able to resolve the issue by using the client ID and client secret from the PAT, as I was using them in API Management before.
Thanks!
system
(system)
Closed
8
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.