# How do you configure Postman with a Google Service Account to use OAuth2.0?

**URL:** <https://community.postman.com/t/how-do-you-configure-postman-with-a-google-service-account-to-use-oauth2-0/24971>\
**Category:** Help Hub\
**Tags:** authentication\
**Created:** [June 17, 2021, 5:42pm UTC](https://community.postman.com/t/how-do-you-configure-postman-with-a-google-service-account-to-use-oauth2-0/24971 "2021-06-17T17:42:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![g-anderson](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@g-anderson](https://community.postman.com/u/g-anderson)\
**Post date:** [June 17, 2021, 5:42pm UTC](https://community.postman.com/t/how-do-you-configure-postman-with-a-google-service-account-to-use-oauth2-0/24971/1 "2021-06-17T17:42:25Z")

</div>

Hi,  
I have been searching for an example but having no luck, so creating a new post here.  
(Apologies if an example exists already, please direct me.)

How do you configure Postman with a Google Service Account to use OAuth2.0 ?

My Google Service Account has been enabled to access specific Google API endpoints.  
I was given a creds.json file with the following key / values (which works in various py scripts).

```auto
"type": "service_account",
  "project_id": "<redacted>",
  "private_key_id": "<redacted>",
  "private_key": <redacted key here>
  "client_email": "foo@bar.com",
  "client_id": "<redacted>",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/<redacted>.com"

```

Unfortunately I don’t see the options to enter this type of service account info into the native OAuth2.0 Configuration Options. For instance, I don’t have a Client Secret. In this case I believe I have to pass my Private Key back to Google to Auth.

I found a post on StackOverFlow  
[https://stackoverflow.com/questions/55205823/postman-and-google-service-account-how-to-authorize](https://stackoverflow.com/questions/55205823/postman-and-google-service-account-how-to-authorize)

Apparently I need to authorize with “Add authorization data to” Request Headers ? Or some other way to pass the creds…

Does anyone have an example to configure Postman with a service account like in my scenario?  
Or a link to docs or a video?

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![g-anderson](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@g-anderson](https://community.postman.com/u/g-anderson)\
**Post date:** [June 17, 2021, 9:00pm UTC](https://community.postman.com/t/how-do-you-configure-postman-with-a-google-service-account-to-use-oauth2-0/24971/2 "2021-06-17T21:00:31Z")

</div>

apparently I need to use \>\>\> [OAuth 2.0 Playground](https://developers.google.com/oauthplayground/)

---

<div class="post-metadata">

**Author:** ![hannah.neil](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/hannah.neil/32/4477_2.png) [@hannah.neil](https://community.postman.com/u/hannah.neil)\
**Post date:** [June 17, 2021, 11:57pm UTC](https://community.postman.com/t/how-do-you-configure-postman-with-a-google-service-account-to-use-oauth2-0/24971/3 "2021-06-17T23:57:37Z")

</div>

Awesome that you figured this out. Thanks for letting us know what worked 🙂 🙂 and welcome to the Postman Community!

---

<div class="post-metadata">

**Author:** ![g-anderson](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@g-anderson](https://community.postman.com/u/g-anderson)\
**Post date:** [June 18, 2021, 1:03pm UTC](https://community.postman.com/t/how-do-you-configure-postman-with-a-google-service-account-to-use-oauth2-0/24971/4 "2021-06-18T13:03:04Z")

</div>

Well, that’s one way to solve this problem with the Google Play Ground tokens, but it would be nice if Postman had an option to pass the creds.json file, rather than the extra step with playground. It seems the a Google API search in Postman does not return “all the Google api” details, prolly more of a Google Fail than Postman…

---

<div class="post-metadata">

**Author:** ![lrsnlsn](https://avatars.discourse-cdn.com/v4/letter/l/3da27b/32.png) [@lrsnlsn](https://community.postman.com/u/lrsnlsn)\
**Post date:** [October 7, 2021, 12:15pm UTC](https://community.postman.com/t/how-do-you-configure-postman-with-a-google-service-account-to-use-oauth2-0/24971/5 "2021-10-07T12:15:28Z")

</div>

How did you use your service account credentials in the playground?

---

<div class="post-metadata">

**Author:** ![g-anderson](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@g-anderson](https://community.postman.com/u/g-anderson)\
**Post date:** [October 7, 2021, 5:12pm UTC](https://community.postman.com/t/how-do-you-configure-postman-with-a-google-service-account-to-use-oauth2-0/24971/6 "2021-10-07T17:12:10Z")

</div>

Sorry , I don’t really remember exactly, only used it to test one time. IIRC, I had to setup my service account in the OAuth2 playground first… then I tested the google api… you need a token for the project, that is the key point.

---

<div class="post-metadata">

**Author:** ![g-anderson](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@g-anderson](https://community.postman.com/u/g-anderson)\
**Post date:** [October 7, 2021, 5:18pm UTC](https://community.postman.com/t/how-do-you-configure-postman-with-a-google-service-account-to-use-oauth2-0/24971/7 "2021-10-07T17:18:37Z")

</div>

I was testing a py script and needed to import \>\>\> from google.oauth2 import service\_account

---

<div class="post-metadata">

**Author:** ![g-anderson](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@g-anderson](https://community.postman.com/u/g-anderson)\
**Post date:** [October 7, 2021, 5:19pm UTC](https://community.postman.com/t/how-do-you-configure-postman-with-a-google-service-account-to-use-oauth2-0/24971/8 "2021-10-07T17:19:28Z")

</div>

from there I was able to test creds set up in the google playground

---

<div class="post-metadata">

**Author:** ![g-anderson](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@g-anderson](https://community.postman.com/u/g-anderson)\
**Post date:** [October 7, 2021, 5:32pm UTC](https://community.postman.com/t/how-do-you-configure-postman-with-a-google-service-account-to-use-oauth2-0/24971/9 "2021-10-07T17:32:53Z")

</div>

use this google auth endpoint \>\>\>“hXXps://accounts.google.com/o/oauth2/auth”  
create an environment to store creds as tokens  
create a collection to save to my collections  
create tokens with \>\>\>\> “hXXps://developers.google.com/oauthplayground/”

For Authorization in my Dev Google Api environment \>  
Type = OAuth2.0  
Add auth data to Request Headers  
Available Tokens  
Header Prefix Bearer

---

<div class="post-metadata">

**Author:** ![g-anderson](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@g-anderson](https://community.postman.com/u/g-anderson)\
**Post date:** [October 7, 2021, 5:44pm UTC](https://community.postman.com/t/how-do-you-configure-postman-with-a-google-service-account-to-use-oauth2-0/24971/10 "2021-10-07T17:44:49Z")

</div>

To be clear I could not pass a creds.json file to the play ground… had to use a token.
