4
Set an environment variable depending on the last run endpoint
Source: Kong/insomnia#3829 · opened by @jason2li
What is your question?
I'm using JWT authentication. I have a /SignIn endpoint and a /Refresh endpoint. Both of them return the same data model, which includes an access token. I'd like to save the last called endpoint to an environment variable called "accessToken". Is this possible?
What is the context?
In my scenario, the user signs in using the /SignIn endpoint. I then save the response to an environment variable called "accessToken". After a certain amount of time that access token will expire, so they need to refresh it by calling the /Refresh endpoint. Because of this call, the original "accessToken" variable is no longer valid. I would like to update the variable to use the new, valid, access token from the /Refresh endpoint.
My understanding of both "chaining" and "environment variables" is that they can only consume from a single endpoint.
Is there a way to do this?
I'm using JWT authentication. I have a /SignIn endpoint and a /Refresh endpoint. Both of them return the same data model, which includes an access token. I'd like to save the last called endpoint to an environment variable called "accessToken". Is this possible?
What is the context?
In my scenario, the user signs in using the /SignIn endpoint. I then save the response to an environment variable called "accessToken". After a certain amount of time that access token will expire, so they need to refresh it by calling the /Refresh endpoint. Because of this call, the original "accessToken" variable is no longer valid. I would like to update the variable to use the new, valid, access token from the /Refresh endpoint.
My understanding of both "chaining" and "environment variables" is that they can only consume from a single endpoint.
Is there a way to do this?
No pledges yet. Be the first to back this.
Comments
Similar requests
Collection Specific Environment Variables Superseding Active Environment Variables
2 votes · 0 comments
Redesign the environment variables
1 vote · 0 comments
Allow Environment variables as command line params to inso cli
7 votes · 0 comments
New shortcut for Base Environment and/or mask Private environment variables on dialog open
2 votes · 0 comments
Right Click Set Environment Variables
2 votes · 0 comments
No comments yet.