# Using OAuth 2.0 Tokens with Team Workspaces and different environments

**URL:** <https://community.postman.com/t/using-oauth-2-0-tokens-with-team-workspaces-and-different-environments/2818>\
**Category:** Help Hub\
**Tags:** environments, oauth2, workspaces\
**Created:** [September 28, 2018, 3:09pm UTC](https://community.postman.com/t/using-oauth-2-0-tokens-with-team-workspaces-and-different-environments/2818 "2018-09-28T15:09:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mduncan](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mduncan](https://community.postman.com/u/mduncan)\
**Post date:** [September 28, 2018, 3:09pm UTC](https://community.postman.com/t/using-oauth-2-0-tokens-with-team-workspaces-and-different-environments/2818/1 "2018-09-28T15:09:25Z")

</div>

- 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?

---

<div class="post-metadata">

**Author:** ![ProgrammerNerd](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@ProgrammerNerd](https://community.postman.com/u/ProgrammerNerd)\
**Post date:** [December 12, 2018, 6:53pm UTC](https://community.postman.com/t/using-oauth-2-0-tokens-with-team-workspaces-and-different-environments/2818/2 "2018-12-12T18:53:37Z")

</div>

I’ve bumped into a similar situation. We have a different OAuth server for each environment, yet it appears like I can only setup a single OAuth provider regardless of the environment.

I tried making multiple collections and assigning different Authorization clients to each one, but when I update the client in one collection, it gets updated in the others. Very frustrating.

---

<div class="post-metadata">

**Author:** ![lanebr](https://avatars.discourse-cdn.com/v4/letter/l/71c47a/32.png) [@lanebr](https://community.postman.com/u/lanebr)\
**Post date:** [May 29, 2020, 3:53pm UTC](https://community.postman.com/t/using-oauth-2-0-tokens-with-team-workspaces-and-different-environments/2818/3 "2020-05-29T15:53:46Z")

</div>

Token management has always been and continues to be an issue. Vote here: [https://github.com/postmanlabs/postman-app-support/issues/6115](https://github.com/postmanlabs/postman-app-support/issues/6115)

and/or here:

> <https://github.com/postmanlabs/postman-app-support/issues/6833>
>
> Is your feature request related to a problem? Please describe.
> When developing against multiple authentication servers, I often have to edit the...
