FAQ:
Why are we using the Google API?
We're trying to automate the Usermanagment such as Roles in the Company, Calendar Events, Groups, Chatrooms
In which cases does it make sense to use the Google API?
In every case the Google API offers a solution (and you want to automate)
What is an Oauth 2.0 Token?
OAuth 2.0 is an authorization protocol and NOT an authentication protocol. As such, it is designed primarily as a means of granting access to a set of resources, for example, remote APIs or user’s data.
Starting off with POSTMAN
How to generate an OAuth 2.0 token:
- Ensure that the Google APIs are enabled
Go to the API Console.
Select a project or create a new one.
Select APIs & services
Select Library
Click the API you want to enable
Click ENABLE.
- Create an OAuth 2.0 client ID
Go to Google Console
-> API
-> OAuth consent screen
Add `getpostman.com` to the Authorized domains.
Click Save.
Go to Google Console
-> API
-> Credentials
Click 'Create credentials'
-> OAuth client ID
-> Web application
Name: 'getpostman'
Authorized redirect URIs: https://www.getpostman.com/oauth2/callback
Copy the generated Client ID and Client secret fields for later use
In Postman select Authorization tab and select "OAuth 2.0" type.
Click 'Get New Access Token'
Fill the GET NEW ACCESS TOKEN form as following
Token Name: 'Google OAuth getpostman'
Grant Type: 'Authorization Code'
Callback URL: https://www.getpostman.com/oauth2/callback
Auth URL: https://accounts.google.com/o/oauth2/auth
Access Token URL: https://accounts.google.com/o/oauth2/token
Client ID: Client ID generated in the step 2 (also shown in downloadable JSON)
Client Secret: Client secret generated in the step 2 (also shown in downloadable JSON)
Scope: see the Google docs for the required OAuth scope (e.g., https://www.googleapis.com/auth/cloud-platform
)
State: -
Client Authentication: "Send as Basic Auth header"
Click 'Request Token' and 'Use Token'
The generated Token is only usable for the Scope you intended it to be. If you need another Scope you might want to Request another token. Otherwise you might face access right problems.
Usefull Links for API Documentations:
Google Projects and Userroles (GCP):
https://cloud.google.com/iam/docs/viewing-grantable-rolesManage Google Users (GW):
https://developers.google.com/admin-sdk/directory/v1/guides/manage-usersAdd Members to Groups:
https://developers.google.com/admin-sdk/directory/v1/guides/manage-group-members
Top comments (0)