How to Create Google Service Accounts

This step by step guide explains how you can create a Google service account using the Google developer console. We’ll also see how to enable Google APIs that our application will access via the service account credentials.

  1. Go to console.developers.google.com and create a new project. Let’s call this Service Accounts Tutorial.

create-service-account

  1. Go to the Library section and enable a couple of Google APIs and service that you will use in the project.

API Manager

  1. Enable the Admin SDK. This will allow the Google Apps domain to manage the users in the domain.

Admin SDK

  1. Go to the menu, choose IAM & Admin, Service Accounts and create a new service account.

Set the Role as Service Account Actor, choose JSON for the private key, enable Google Workspace Domain-wide delegation. This is essential since we would like the application to access the data of all user’s in the Google Workspace domain without manual authorization on their part.

service-account-domain-wide-delegation

The JSON file that contains the client credential will download to your computer. Store it in a safe location because you will not be able to download it again.

The service account has been successfully created. The JSON fill will the Private key and the Client Email that will use in our application. The file will also have the Client ID that will need to whitelist this application in the Google Apps admin console.

google-apps-service-account-private-key

In the next chapter, we’ll see how the Google Workspace domain administrator can setup the OAuth2 application inside admin console for domain wide delegation.

Amit Agarwal

Amit Agarwal

Google Developer Expert, Google Cloud Champion

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India.

Amit has developed several popular Google add-ons including Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Awards & Titles

Digital Inspiration has won several awards since it's launch in 2004.

Google Developer Expert

Google Developer Expert

Google awarded us the Google Developer Expert award recogizing our work in Google Workspace.

ProductHunt Golden Kitty

ProductHunt Golden Kitty

Our Gmail tool won the Lifehack of the Year award at ProductHunt Golden Kitty Awards in 2017.

Microsoft MVP Alumni

Microsoft MVP Alumni

Microsoft awarded us the Most Valuable Professional (MVP) title for 5 years in a row.

Google Cloud Champion

Google Cloud Champion

Google awarded us the Champion Innovator title recognizing our technical skill and expertise.

Email Newsletter

Sign up for our email newsletter to stay up to date.

We will never send any spam emails. Promise.