Kong / Kong/insomnia

Implicit OAuth2 - Token not automatically re-fetched when expire

Open
#6,302 0 comments 0 reactions 0 assignees View on GitHub
A-oauth B-bug S-unverified
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

### Expected Behavior

I would expect when I send a request, Insomnia to re-fetch an OAuth2 token automatically if the current one is expired.

This is how it works for other grant types, but it seems like it is not the case for Implicit grant type.

### Actual Behavior

When my token expires, the request still uses it and it fails.

I need to manually go to the Authn tab and click the "Refresh Token" button.

### Reproduction Steps

1. Setup Implicit grant type as authn
2. Fetch token and send request - everything is working
3. Wait for the token to expire
4. Send request - token is expired
5. Click Refresh Token and send request - everything is working

### Is there an existing issue for this?

- [X] I have searched the [issue tracker](https://www.github.com/Kong/insomnia/issues) for this problem.

### Additional Information

_No response_

### Insomnia Version

2023.5.2

### What operating system are you using?

macOS

### Operating System Version

13.4.1

### Installation method

downloaded

### Last Known Working Insomnia version

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the implicit-grant flow described in the issue, then trace the authentication request path that decides whether an OAuth2 token is expired or reused. Compare it with the other grant types that refresh automatically; done means an expired implicit-grant token is fetched again before the request is sent.

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.