Skip to content

Commit ebc53f1

Browse files
authored
Merge pull request #525 from infrabel/feature/updated-docs-proxy-configuration
Added configuration example in README.md when configuring a GraphServiceClient behind a corporate HTTP proxy
2 parents 408e7ab + 99659c8 commit ebc53f1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ You must create **GraphServiceClient** object to make requests against the servi
7777
from azure.identity.aio import ClientSecretCredential
7878
from msgraph import GraphServiceClient
7979

80-
credential = ClientSecretCredential(
80+
credentials = ClientSecretCredential(
8181
'TENANT_ID',
8282
'CLIENT_ID',
8383
'CLIENT_SECRET',
8484
)
8585
scopes = ['https://graph.microsoft.com/.default']
86-
client = GraphServiceClient(credentials=credential, scopes=scopes)
86+
client = GraphServiceClient(credentials=credentials, scopes=scopes)
8787
```
8888

8989
The above example uses default scopes for [app-only access](https://learn.microsoft.com/en-us/graph/permissions-overview?tabs=http#application-permissions). If using [delegated access](https://learn.microsoft.com/en-us/graph/permissions-overview#delegated-permissions) you can provide custom scopes:
@@ -93,14 +93,16 @@ The above example uses default scopes for [app-only access](https://learn.micros
9393
from azure.identity import DeviceCodeCredential
9494
from msgraph import GraphServiceClient
9595

96-
credential=DeviceCodeCredential(
96+
credentials = DeviceCodeCredential(
9797
'CLIENT_ID',
9898
'TENANT_ID',
9999
)
100100
scopes = ['User.Read', 'Mail.Read']
101-
client = GraphServiceClient(credentials=credential, scopes=scopes)
101+
client = GraphServiceClient(credentials=credentials, scopes=scopes)
102102
```
103103

104+
> **Note**: Refer to the [following documentation page](https://learn.microsoft.com/graph/sdks/customize-client?tabs=python#configuring-the-http-proxy-for-the-client) if you need to configure an HTTP proxy.
105+
104106
## 3. Make requests against the service
105107

106108
After you have a **GraphServiceClient** that is authenticated, you can begin making calls against the service. The requests against the service look like our [REST API](https://docs.microsoft.com/graph/api/overview?view=graph-rest-1.0).

0 commit comments

Comments
 (0)