Refreshed Token doesn't work
See original GitHub issueHi,
I have an issue with the refreshed token.
Explanations :
My app is on my dedicated server, run with wsgi and is served by nginx through my domain name. In my app.py I log to O365 like this :
token_backend = FileSystemTokenBackend(token_path='./', token_filename='o365_token.txt')
account = Account(o365_credentials, token_backend=token_backend)
Before using my app, I collected a auth token with another script “auth.py” that I launched to follow the auth process (visit the URL and paste back the new auth URL). Here is my code in “auth.py”:
client_id = "PRIVATE"
client_secret = "PRIVATE"
credentials = (client_id, client_secret)
token_backend = FileSystemTokenBackend(token_path='./', token_filename='o365_token.txt')
account = Account(credentials, token_backend=token_backend)
token = account.authenticate(scopes=['offline_access', 'Calendars.Read', 'Calendars.Read.Shared', 'Calendars.ReadWrite', 'Calendars.ReadWrite.Shared'])
When I follow the auth step, I see that a file called “o365_token.txt” appears and when I read it I see there is a “refresh token” line. However, the token expires after 60minutes and after that I can’t use the API. I can’t figure out why…
Thanks for helping. I tried a lot of differents things to get a refreshed token, without success.
Seevoid
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (6 by maintainers)
Top GitHub Comments
OK everything works well now, I can refresh the token properly. This cause was because I created my previous app under a school organization in Azure so I didn’t have the good permissions…
Thanks a lot for your help 😃
OK thanks for your support. I tried with thoses scopes : [‘basic’, ‘calendar_all’]
I’ll try to use the API in one hour to check if it’s ok. I’ll give you my feedback.