insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

OAuth2 `Fetch token` in Auth tab fails to parse out tokens from server response.

Open tkarakai opened this issue 4 years ago • 5 comments

It goes through the authorization_code grant type flow correctly, all the way to issuing the POST request to the access_token_uri, the response from the server seems to be correct with the tokens, yet Insomnia reports that it "Failed to fetch token ... status=0" and does not parse out the tokens.

There is nothing useful in the Developer Tools console.

I had to install a local proxy to see the actual http communication (btw, it would be useful to see the oauth2 traffic in the Timeline tab, I think)

The access_token in the server response is a valid JWT token. This is the server response that Insomnia failed to parse out the tokens from:

HTTP/1.1 200 OK
Date: Wed, 15 Apr 2020 21:00:08 GMT
Content-Type: application/json
Content-Length: 1090
Content-Encoding: chunked
X-B3-TraceId: 6c55574578445a36
Server: DexcomApiGateway/1.0.0
Via: 1.1 google, 1.1 google

{"access_token":"{VALID_JWT_TOKEN}","refresh_token":"refreshtoken1","expires_in":600,"token_type":"Bearer"}

Insomnia v7.1.1.3350 on macOS

Please see my setup:

Screen Shot 2020-04-15 at 4 05 42 PM

tkarakai avatar Apr 15 '20 21:04 tkarakai

It looks like the POST access_token_uri is not being executed by the main Insomnia process, it is executed by the "Insomnia Helper" process instead. Is it possible that this process cannot communicate the results back to the mothership?

tkarakai avatar Apr 15 '20 22:04 tkarakai

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 31 '21 04:05 stale[bot]

any update here?

bczak avatar Aug 30 '22 15:08 bczak

I do have the same issue, maybe someone should try to build from source to find out where it is caused exactly and open a pr?

cubimon avatar Aug 31 '22 15:08 cubimon

same here

erwan-joly avatar Jul 05 '23 11:07 erwan-joly

image This resolved it for me

cubimon avatar Sep 06 '23 14:09 cubimon