Skip to content

Commit a6b1872

Browse files
committed
Update sample in README to use InteractiveBrowserCredential for authentication
1 parent 0b48eff commit a6b1872

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,24 @@ To call Microsoft Graph, your app must acquire an access token from the Microsof
2626
### 3. Import modules
2727

2828
```python
29-
from azure.identity import ClientSecretCredential
29+
from azure.identity import InteractiveBrowserCredential
3030
from msgraph.core import GraphClient
3131
```
3232

3333
### 4. Configure a Credential Object
3434

3535
```python
36-
# Using ClientSecretCredential for demonstration purposes.
36+
# Using InteractiveBrowserCredential for demonstration purposes.
3737
# There are many other options for getting an access token. See the following for more information.
3838
# https://pypi.org/project/azure-identity/
3939

40-
credential = ClientSecretCredential(
41-
tenant_id='xxxxxxxxxxx',
42-
client_id='xxxxxxxxxxx',
43-
client_secret='xxxxxxxxx'
44-
)
40+
browser_credential = InteractiveBrowserCredential(client_id='YOUR_CLIENT_ID')
4541
```
4642

4743
### 5. Pass the credential object to the GraphClient constructor.
4844

4945
```python
50-
client = GraphClient(credential=credential)
46+
client = GraphClient(credential=browser_credential)
5147
```
5248

5349
### 6. Make a requests to the graph using the client

0 commit comments

Comments
 (0)