Skip to content

Commit 8353bf9

Browse files
authored
Update README.md
Update two-step auth page with missing imports and clarify variables
1 parent 05ec96f commit 8353bf9

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,15 @@ For the "with your own identity" authentication method, you can just use `accoun
290290

291291
The following example is done using Flask.
292292
```python
293+
from flask import request
294+
from O365 import Account
295+
296+
293297
@route('/stepone')
294298
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
295301

296-
callback = 'my absolute url to auth_step_two_callback'
297302
account = Account(credentials)
298303
url, state = account.con.get_authorization_url(requested_scopes=my_scopes,
299304
redirect_uri=callback)
@@ -313,7 +318,10 @@ For the "with your own identity" authentication method, you can just use `accoun
313318
# rebuild the redirect_uri used in auth_step_one
314319
callback = 'my absolute url to auth_step_two_callback'
315320

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,
317325
state=my_saved_state,
318326
redirect_uri=callback)
319327
# if result is True, then authentication was succesful
@@ -440,7 +448,7 @@ Methods that stores tokens:
440448

441449
To store the token you will have to provide a properly configured TokenBackend.
442450

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.):
444452
- `FileSystemTokenBackend` (Default backend): Stores and retrieves tokens from the file system. Tokens are stored as files.
445453
- `EnvTokenBackend`: Stores and retrieves tokens from environment variables.
446454
- `FirestoreTokenBackend`: Stores and retrives tokens from a Google Firestore Datastore. Tokens are stored as documents within a collection.

0 commit comments

Comments
 (0)