File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -31,19 +31,14 @@ device_credential = DeviceCodeCredential(
31
31
32
32
```
33
33
34
- Create AuthorizationProvider, AuthorizationHandler and list of middleware
34
+ Create an authorization provider object and a list of scopes
35
35
``` python
36
36
auth_provider = TokenCredentialAuthProvider(device_credential)
37
- options = AuthMiddlewareOptions([' mail.send' , ' user.read' ])
38
- auth_handler = AuthorizationHandler(auth_provider, auth_provider_options = options)
39
-
40
- middleware = [
41
- auth_handler
42
- ]
37
+ scopes = [' mail.send' , ' user.read' ]
43
38
```
44
39
45
40
``` python
46
- graph_session = GraphSession(middleware = middleware )
41
+ graph_session = GraphSession(scopes, auth_provider )
47
42
result = graph_session.get(' /me' )
48
43
print (result.json())
49
44
```
Original file line number Diff line number Diff line change 1
1
"""
2
- Creates a session object
2
+ Graph Session
3
3
"""
4
4
from requests import Session , Request , Response
5
5
You can’t perform that action at this time.
0 commit comments