- In our Team Workspace we have a Collection that has Authorization set to use OAuth 2.0.
- All folders/requests in this collection use Inherit from Auth
Managed tokens (created from Get New Access Token) are isolated to each user’s instance of Postman BUT the actual Access Token field on the Collection is not.
So we could use an environment/global variable for that field. However the issue here is that I don’t see a way to
- access Access Tokens as variables
- or the fields in them (access token, refresh_token) as variables or programmatically using something like
pm.variables.get("variable_key");
So the only way to get these values into env variables is by manually copy/pasting them.
Ironically this is actually EASIER to do when I don’t use the built in OAuth 2.0 flow because using a regular request I can at least programmatically set those variables by scripting them in Tests for a request.
Additionally I cannot manage tokens per environment.
Am I missing something or manually copy/paste the only way to get returned access token data into variables?