@@ -290,10 +290,15 @@ For the "with your own identity" authentication method, you can just use `accoun
290
290
291
291
The following example is done using Flask.
292
292
```python
293
+ from flask import request
294
+ from O365 import Account
295
+
296
+
293
297
@ route(' /stepone' )
294
298
def auth_step_one():
299
+ # callback = absolute url to auth_step_two_callback() page, https://domain.tld/steptwo
300
+ callback = url_for(' auth_Step_two_callback' , _external = True ) # Flask example
295
301
296
- callback = ' my absolute url to auth_step_two_callback'
297
302
account = Account(credentials)
298
303
url, state = account.con.get_authorization_url(requested_scopes = my_scopes,
299
304
redirect_uri = callback)
@@ -313,7 +318,10 @@ For the "with your own identity" authentication method, you can just use `accoun
313
318
# rebuild the redirect_uri used in auth_step_one
314
319
callback = ' my absolute url to auth_step_two_callback'
315
320
316
- result = account.con.request_token(request.url,
321
+ # get the request URL of the page which will include additional auth information
322
+ requested_url = request.url # uses Flask's request() method
323
+
324
+ result = account.con.request_token(requested_url,
317
325
state = my_saved_state,
318
326
redirect_uri = callback)
319
327
# if result is True, then authentication was succesful
@@ -440,7 +448,7 @@ Methods that stores tokens:
440
448
441
449
To store the token you will have to provide a properly configured TokenBackend.
442
450
443
- There are a few `TokenBackend` classes implemented (and you can easely implement more like a CookieBackend, RedisBackend, etc.):
451
+ There are a few `TokenBackend` classes implemented (and you can easily implement more like a CookieBackend, RedisBackend, etc.):
444
452
- `FileSystemTokenBackend` (Default backend): Stores and retrieves tokens from the file system. Tokens are stored as files.
445
453
- `EnvTokenBackend` : Stores and retrieves tokens from environment variables.
446
454
- `FirestoreTokenBackend` : Stores and retrives tokens from a Google Firestore Datastore. Tokens are stored as documents within a collection.
0 commit comments