Philippe
(Philippe)
April 7, 2023, 9:28am
1
I’ve made a collection and added the oath2.0 authorization, this works.
I’ve added a request and set the authorization to inherit from the parent, but when I run the request I get the error:
{
“error”: {
“code”: “InvalidAuthenticationToken”,
“message”: “Access token is empty.”,
“innerError”: {
“date”: “2023-04-07T09:26:22”,
“request-id”: “f1030c0e-8282-44f5-ac4f-3acc65d4146d”,
“client-request-id”: “f1030c0e-8282-44f5-ac4f-3acc65d4146d”
}
}
}
When I change the authorization to “Bearer token” and copy paste the token from the collection, the request works.
What am I missing?
The request is a simple MS Graph request: https://graph.microsoft.com/v1.0/me
This is the authorization on collection level:
And the structure:
1 Like
w4dd325
(w4dd325)
April 7, 2023, 11:30am
2
Hi @Philippe
Is it possible to share a screenshot of how you have configured your auth (changing sensitive values to xxxxx or something like that) … and also of the collection / folder structure you are using?
Philippe
(Philippe)
April 7, 2023, 11:38am
4
Sure, I’ve added it to my original post.
w4dd325
(w4dd325)
April 7, 2023, 12:06pm
5
At the top of your screenshot, above where it says “token expired”, are there are “available” tokens?
It’s been a little while since I played with this, but if there are no available tokens, I think you have to refresh the token at the top, then once a token exists it should auto-refresh when you send requests.
(I think)
Philippe
(Philippe)
April 7, 2023, 12:47pm
7
It said expired because I left it for a while, even when I press refresh and use token, the request still gives me the same error message.
w4dd325
(w4dd325)
April 7, 2023, 12:49pm
8
In the headers tab of the ‘mailFolders’ API call, do you see the token being passed in the header?
It should be greyed out as it would be an auto-generated header, but you should see the key/value pair.
w4dd325
(w4dd325)
April 7, 2023, 12:54pm
9
This might help… (Auth is 2 minutes in)
Philippe
(Philippe)
April 7, 2023, 12:56pm
10
This is what I see in the headers:
I do see the token in the params:
The video didn’t help.
Philippe
(Philippe)
April 7, 2023, 1:44pm
11
Found the solution, “Add auth data to” was set to “Request URL”
Once I changed it to “Request headers” it works like a charm.
@w4dd325 Thanks for the help!
w4dd325
(w4dd325)
April 7, 2023, 2:27pm
12
Glad you resolved your issue