You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/oauth-server.md
+23-8Lines changed: 23 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,13 @@ If you have a G Suite domain—if you use [G Suite](https://gsuite.google.com/),
8
8
9
9
> **Note:** When you use [G Suite Marketplace](https://www.google.com/enterprise/marketplace/) to install an application for your domain, the required permissions are automatically granted to the application. You do not need to manually authorize the service accounts that the application uses.
10
10
11
-
> **Note:** Although you can use service accounts in applications that run from a Google Apps domain, service accounts are not members of your Google Apps account and aren't subject to domain policies set by Google Apps administrators. For example, a policy set in the Google Apps admin console to restrict the ability of Apps end users to share documents outside of the domain would not apply to service accounts.
11
+
> **Note:** Although you can use service accounts in applications that run from a G Suite domain, service accounts are not members of your G Suite account and aren't subject to domain policies set by G Suite administrators. For example, a policy set in the G Suite Admin console to restrict the ability of G Suite end users to share documents outside of the domain would not apply to service accounts. Similarly, that policy would prevent users from sharing documents with service accounts, because service acounts are always outside of the domain. If you're using G Suite domain-wide delegation, this isn't relevant to you - you are accessing APIs while acting as a domain user, not as the service account itself.
12
12
13
13
This document describes how an application can complete the server-to-server OAuth 2.0 flow by using the Google APIs Client Library for Python.
14
14
15
15
## Overview
16
16
17
-
To support server-to-server interactions, first create a service account for your project in the API Console. If you want to access user data for users in your Google Apps domain, then delegate domain-wide access to the service account.
17
+
To support server-to-server interactions, first create a service account for your project in the API Console. If you want to access user data for users in your G Suite domain, then delegate domain-wide access to the service account.
18
18
19
19
Then, your application prepares to make authorized API calls by using the service account's credentials to request an access token from the OAuth 2.0 auth server.
20
20
@@ -44,19 +44,19 @@ Take note of the service account's email address and store the service account's
44
44
45
45
## Delegating domain-wide authority to the service account
46
46
47
-
If your application runs in a Google Apps domain and accesses user data, the service account that you created needs to be granted access to the user data that you want to access.
47
+
If your application runs in a G Suite domain and accesses user data, the service account that you created needs to be granted access to the user data that you want to access.
48
48
49
-
The following steps must be performed by an administrator of the Google Apps domain:
49
+
The following steps must be performed by an administrator of the G Suite domain:
50
50
51
-
1. Go to your Google Apps domain’s [Admin console](http://admin.google.com/).
51
+
1. Go to your G Suite domain’s [Admin console](https://admin.google.com/).
52
52
1. Select **Security** from the list of controls. If you don't see **Security** listed, select **More controls** from the gray bar at the bottom of the page, then select **Security** from the list of controls. If you can't see the controls, make sure you're signed in as an administrator for the domain.
53
53
1. Select **Advanced settings** from the list of options.
54
54
1. Select **Manage third party OAuth Client access** in the **Authentication** section.
55
55
1. In the **Client name** field enter the service account's **Client ID**.
56
-
1. In the **One or More API Scopes** field enter the list of scopes that your application should be granted access to. For example, if your application needs domain-wide access to the Google Drive API and the Google Calendar API, enter: `https://www.googleapis.com/auth/drive`, `https://www.googleapis.com/auth/calendar`.
56
+
1. In the **One or More API Scopes** field enter the list of scopes that your application should be granted access to. For example, if your application needs domain-wide access to the Google Drive API and the Google Calendar API, enter: `https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/calendar`.
57
57
1. Click **Authorize**.
58
58
59
-
Your application now has the authority to make API calls as users in your domain (to "impersonate" users). When you prepare to make authorized API calls, you specify the user to impersonate.
59
+
Your application now has the authority to make API calls as users in your domain (to "impersonate" users). When you prepare to make authorized API calls, you specify the user to impersonate in the `subject` argument.
Use the `Credentials` object to call Google APIs in your application. The API requests would be authorized as `[email protected]`, if you've authorized the service account accordingly in the G Suite Admin console.
126
+
127
+
113
128
## Calling Google APIs
114
129
115
130
To call a Google API using the `Credentials` object, complete the following steps:
0 commit comments