[Usability] Stale OAuth access token used after switching environments #3564
Replies: 25 comments 1 reply
-
This seems like a large frustration, thanks for pointing it out @nathanwaldman. At the moment, tokens are stored per request, not per URL. Perhaps it would be better to key them on request+hostname which would provide the experience you are looking for. |
Beta Was this translation helpful? Give feedback.
-
The simple workaround is to clear the token on the request, so this isn't high priority. Your suggestion of tying the token to the request+hostname would solve my issue. In general, maybe it has to be tied to the request+username+hostname? |
Beta Was this translation helpful? Give feedback.
-
Ya, you are probably correct. The values used to generate the key might depend on what Grant Type is used. |
Beta Was this translation helpful? Give feedback.
-
I also run into this issue constantly when switching environments. While the proposed solution would work, I always thought it was a little weird to setup OAuth on a per-request basis. I had to copy my OAuth config across my entire set of APIs, even though they all shared the same authentication system, being part of the same API. In other words, I was thinking that a better way to solve this would be to have the Authentication be linked to something more high-level than the request (like environment), so that when you switch to a different environment, the tokens would also switch. |
Beta Was this translation helpful? Give feedback.
-
Yeah, I often duplicate an existing request so that I don't have to reconfigure the OAuth security. |
Beta Was this translation helpful? Give feedback.
-
Clearing or refreshing Access Tokens on Environment switch would make a better UX than current. |
Beta Was this translation helpful? Give feedback.
-
Would love to see folder-based authentication. Having imported a collection from Postman I now need to update the authentication settings for each request separately, which is quite tedious. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
We need this feature to share access tokens between request without reconfiguring all requests. We'd like to have a single request to autenticate, which will save the token in the environment, then use that environment variable as bearer on all other requests |
Beta Was this translation helpful? Give feedback.
-
We would use those token even on separate endpoints |
Beta Was this translation helpful? Give feedback.
-
@t-ricci-molecle, I'm not sure this issue would help you do that (maybe provide more details on your use case if you think it does). It sounds like what you're after is reusable authentication. You can already create an authentication request manually and use Chaining to reference a value from it's response in other requests. |
Beta Was this translation helpful? Give feedback.
-
@gschier nope, not helpful with OAuth 2.0 (Auth0 in my case, which also requires custom GET query parameters which I cannot set in the Insomnia OAuth 2.0 autentication) |
Beta Was this translation helpful? Give feedback.
-
@t-ricci-molecle that make sense. I'm still not sure how what you describe relates to this issue, though. Can you elaborate? Feel free to create a separate issue describing your use case. |
Beta Was this translation helpful? Give feedback.
-
I would love to see this added. Currently we have several environments (that all share the same pattern): dev, sandbox, staging, demo, prod, prod europe, etc. They are all different environments and have different id's/secrets. Clearing the token on environment switch (per audvin's comment above) would work great for what I'm doing. |
Beta Was this translation helpful? Give feedback.
-
I'm surprised this is closed. I think a big reason why people are switching to Insomnia from Postman is because of the more convenient token generating, only to find that it's still not totally convenient. |
Beta Was this translation helpful? Give feedback.
-
Reopening this! |
Beta Was this translation helpful? Give feedback.
-
How would one implement this workaround? Would I use a plugin that evaluates some script before running a request? We need the ability to clear tokens because we have users with different credentials and different stages. We often have to switch between them and cannot use Insomnia without the ability to clear the token cache (or having it cache the value including the username)... |
Beta Was this translation helpful? Give feedback.
-
How would one implement this workaround? I still don't see how that would work, because I'm not aware how to access Insomnia token cache (and where I could trigger such a script)... I would argue this has a higher priority if there's no workaround. For us it's a block before we could use Insomnia. |
Beta Was this translation helpful? Give feedback.
-
@kossmoboleat for my use case, for a particular request on the Auth/OAuth2.0 tab I just need to remember to click the "Clear" button after switching environments. Then when I send the request Insomnia will re-fetch the access token. |
Beta Was this translation helpful? Give feedback.
-
@nathanwaldman Ah right, that works. For some reason I didn't think of looking there. I had been experimenting with the env authentication plugin which of course has no UI... |
Beta Was this translation helpful? Give feedback.
-
I'm kinda having a bad experience due to something similar to this. Imagine this workflow happening in a few minutes
It would be nice if the Tokens were stored between different Envs and switching back and forth between Evns before their expiration doesn't force me to get a new Token (and having to Login and 2FA every single time I change Env which is quite annoying and time consuming). EDIT: IDK if it is possible, but having the different Login+2FA cookies/sessions stored between the different Envs (to Refresh the tokens) would be awesome too. I usually have an awesome User experience if I don't switch Envs, but switching Envs is a pain. |
Beta Was this translation helpful? Give feedback.
-
It would greatly improve the UX to either automatically clear the auth tokens on env switching or support storing auth tokens by env. |
Beta Was this translation helpful? Give feedback.
-
One of the biggest pain points using Insomnia, hope this will be implemented soon 👍 |
Beta Was this translation helpful? Give feedback.
-
This issue was created May 2017. It is March 2021 and this is still an issue. Please fix this! I work in an enterprise environment and we are testing between postman and insomnia and I like the insomnia ease of use but this issue is a big deal. It is such a simple fix. On environment change just clear all of the tokens automatically. Why hasn't this been implemented yet? |
Beta Was this translation helpful? Give feedback.
-
In current Insomnia there's a setting in General -> Request / Response -> "Filter responses by environment", which makes responses not visible between environments, and this fixes the issue with tokens from one environment being sent on another. |
Beta Was this translation helpful? Give feedback.
-
Overview
Insomnia Version:
5.1.0Operating System:
MacOS 10.11.3Summary:
Switching environments retains OAuth 2 refresh and access tokens when they may no longer be valid.How To Reproduce
Beta Was this translation helpful? Give feedback.
All reactions