Ballerina Security

How to obtain Google OAuth2.0 Credentials

  1. Visit Google API Console.
  2. Click Create Project, and follow the wizard to create a new project.
  3. Go to Dashboard, click on ENABLE APIS AND SERVICES and select the Google API you want, and click ENABLE.
  4. Go to the Credentials → OAuth consent screen, enter a product name to be shown to users, and click Save.
  5. On the Credentials tab, click Create credentials and select OAuth Client ID.
  6. Select an application type, enter a name for the application, and specify a redirect URI.
    • NOTE: Enter https://developers.google.com/oauthplayground if you want to use OAuth 2.0 playground to receive the Authorization Code, Access Token, and Refresh Token. vi. Click Create. Your Client ID and Client Secret will appear as a popup.
  7. Visit OAuth 2.0 playground, in a separate browser window or tab.
  8. Click the ⚙️ (settings icon) in the top right corner, and you can obtain the Token endpoint.
  9. Tick Use your OAuth credentials in pop-down of ⚙️ and paste the obtained Client ID and Client Secret there.
  10. On the left side of the window, under Step 1 - Select & authorize APIs, select the required Google API scopes, and then click Authorize APIs.
  11. When you receive your Authorization Code, click Exchange Authorization Code for tokens to obtain the Refresh Token and Access token.

Now you have obtained the followings: