Kong / Kong/insomnia

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

Open
#2,037 6 comments 0 reactions 0 assignees View on GitHub
needs-triage
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

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

Contributor guide

Open the contributing guide

Research direction

Start in the Auth tab's OAuth2 “Fetch token” flow and inspect how the access_token_uri response is parsed. Reproduce the authorization_code flow with the JSON response shown in the issue; done means the access and refresh tokens are extracted and the token fetch succeeds without status=0.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.