# OAuth 2.0 is shared between all requests and collections

**URL:** <https://community.postman.com/t/oauth-2-0-is-shared-between-all-requests-and-collections/319>\
**Category:** Help Hub\
**Tags:** authentication, oauth2\
**Created:** [November 23, 2017, 11:47am UTC](https://community.postman.com/t/oauth-2-0-is-shared-between-all-requests-and-collections/319 "2017-11-23T11:47:24Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![clokers80](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@clokers80](https://community.postman.com/u/clokers80)\
**Post date:** [November 23, 2017, 11:47am UTC](https://community.postman.com/t/oauth-2-0-is-shared-between-all-requests-and-collections/319/1 "2017-11-23T11:47:24Z")

</div>

I create a collection and set OAuth2.0 with Grant Type to Client Credentials

 ![Schermata del 2017-11-23 11-38-08](https://us1.discourse-cdn.com/getpostman/original/3X/b/3/b3d11437652af8f5ebd2d60545daa97c63d36662.png)

If I create a new collection (or request) and in OAuth I want to set Grant Type to Authorization Code I also change the others.  
Can I not have two Access Token with two different clients for her different collections (or requests)?

---

<div class="post-metadata">

**Author:** ![kamalaknn](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kamalaknn/32/93_2.png) [@kamalaknn](https://community.postman.com/u/kamalaknn)\
**Post date:** [November 28, 2017, 10:01am UTC](https://community.postman.com/t/oauth-2-0-is-shared-between-all-requests-and-collections/319/2 "2017-11-28T10:01:59Z")

</div>

Hi,

The `Get New Access Token` dialog allows you to get an access token from an Auth provider. The details in this dialog only apply for getting the token. Once you’ve got an access token, changing the details in the `Get New Access Token` does not affect previously created tokens.

If you want to use different tokens for different collections, you can just select the token from `Access Tokens` list.

You’ll be able to use different tokens with different requests/collections, though storing different configuration for `Get New Access Token` is not possible yet.

---

<div class="post-metadata">

**Author:** ![clarkritchie](https://avatars.discourse-cdn.com/v4/letter/c/6a8cbe/32.png) [@clarkritchie](https://community.postman.com/u/clarkritchie)\
**Post date:** [August 14, 2018, 6:32pm UTC](https://community.postman.com/t/oauth-2-0-is-shared-between-all-requests-and-collections/319/3 "2018-08-14T18:32:21Z")

</div>

Any update on storing different configurations for `Get New Access Token`? It is rapidly killing me to have to update this dialog whenever I switch projects. Sometimes the tokens are not valid for that long, so going back to use previous tokens isn’t a great workaround. Thank you!

---

<div class="post-metadata">

**Author:** ![ingostrauch](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/ingostrauch/32/1100_2.png) [@ingostrauch](https://community.postman.com/u/ingostrauch)\
**Post date:** [November 21, 2018, 11:33am UTC](https://community.postman.com/t/oauth-2-0-is-shared-between-all-requests-and-collections/319/4 "2018-11-21T11:33:20Z")

</div>

I’d like to support this request, all the systems I deal with use OAuth2 and token lifetime is usually \<5min.  
It would be of great help if I could store multiple settings to get new tokens.

---

<div class="post-metadata">

**Author:** ![manynick](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@manynick](https://community.postman.com/u/manynick)\
**Post date:** [January 7, 2020, 11:19pm UTC](https://community.postman.com/t/oauth-2-0-is-shared-between-all-requests-and-collections/319/5 "2020-01-07T23:19:08Z")

</div>

Still nothing on this?

It’s extremely annoying that you cannot save different OAuth2 client credentials sets per collection

---

<div class="post-metadata">

**Author:** ![edmund.leung](https://avatars.discourse-cdn.com/v4/letter/e/d07c76/32.png) [@edmund.leung](https://community.postman.com/u/edmund.leung)\
**Post date:** [February 12, 2020, 10:57pm UTC](https://community.postman.com/t/oauth-2-0-is-shared-between-all-requests-and-collections/319/6 "2020-02-12T22:57:48Z")

</div>

Any update on this ?

---

<div class="post-metadata">

**Author:** ![Ian\_T\_Price](https://avatars.discourse-cdn.com/v4/letter/i/d9b06d/32.png) [@Ian\_T\_Price](https://community.postman.com/u/Ian_T_Price)\
**Post date:** [June 13, 2020, 3:37pm UTC](https://community.postman.com/t/oauth-2-0-is-shared-between-all-requests-and-collections/319/7 "2020-06-13T15:37:42Z")

</div>

How are others coping with this issue? Are they just not using OAuth2 or just given up using Postman for these connections?

I’m now using Python for all OAuth2 connections because this process just doesn’t work. well

---

<div class="post-metadata">

**Author:** ![Ian\_T\_Price](https://avatars.discourse-cdn.com/v4/letter/i/d9b06d/32.png) [@Ian\_T\_Price](https://community.postman.com/u/Ian_T_Price)\
**Post date:** [June 13, 2020, 4:01pm UTC](https://community.postman.com/t/oauth-2-0-is-shared-between-all-requests-and-collections/319/8 "2020-06-13T16:01:35Z")

</div>

Just updated to 7.26 and found that you can now use the {{Variable}} in the token request

I put

- CallBackURL
- AuthURL
- AccessURL
- TokenScope  
in the Collection variables

and

- clientID
- clientSecret  
in the environment variables

Still no timestamp on the tokens but you can delete them all at once

---

<div class="post-metadata">

**Author:** ![v.a.mudryk](https://avatars.discourse-cdn.com/v4/letter/v/f1d935/32.png) [@v.a.mudryk](https://community.postman.com/u/v.a.mudryk)\
**Post date:** [June 30, 2020, 5:14pm UTC](https://community.postman.com/t/oauth-2-0-is-shared-between-all-requests-and-collections/319/9 "2020-06-30T17:14:57Z")

</div>

Hi! Do you have any updates about this question? The main problem for me is that I need to change the Access Token URL (and Client ID and Client Secret) every time when I change the collection (different API source) for OAuth2 type token.

---

<div class="post-metadata">

**Author:** ![surfgirl84](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@surfgirl84](https://community.postman.com/u/surfgirl84)\
**Post date:** [August 10, 2020, 11:53am UTC](https://community.postman.com/t/oauth-2-0-is-shared-between-all-requests-and-collections/319/10 "2020-08-10T11:53:14Z")

</div>

Hello, I have similar issue, I have collection which jave serveral requests, but as this is flow between Buyer and Seller in the application, it requires to have separate access\_token for each role. I can set one access token at collection level (for Buyer role requests) but it all stops from 100% automation, because I need to manually set it for other (Seller role requests) - any suggestions? Im desparate to be honest, thank you

---

<div class="post-metadata">

**Author:** ![allenheltondev](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/allenheltondev/32/31738_2.png) [@allenheltondev](https://community.postman.com/u/allenheltondev)\
**Post date:** [August 10, 2020, 3:46pm UTC](https://community.postman.com/t/oauth-2-0-is-shared-between-all-requests-and-collections/319/11 "2020-08-10T15:46:42Z")

</div>

You can automate the OAuth2.0 token generation via a pre-request script or through a collection pre-request script.

You can track your different tokens via different variables and use them in the requests.

I’d start with taking a look at how to generate the tokens via a script first, then we can go from there once you get that working.

> **[How to Automate OAuth2 Token Renewal in Postman | Ready, Set, Cloud!](https://www.readysetcloud.io/blog/allen.helton/how-to-automate-oauth2-token-renewal-in-postman-864420d381a0/)**
>
> Discover how to automatically renew your OAuth2 access token in Postman so you never have to click the “Get New Access Token” button again.
