requests-oauthlib icon indicating copy to clipboard operation
requests-oauthlib copied to clipboard

`oauth2_session.OAuth2Session.refresh_token` creates infinite loop with Exchange Online when token expires

Open cmin764 opened this issue 2 years ago • 0 comments

Using an expired access token with Microsoft Exchange Online for sending Outlook e-mails under exchangelib runs into an infinite loop during the token refresh just because the app creds are bundled into the body structure instead of being provided as a (client_id, client_secret) pair given the auth object. (context)

Is it possible to automatically create and use an auth object (if it isn't provided explicitly by the caller) based on these refresh kwargs (if they contain the client creds) right inside of oauth2_session.OAuth2Session.refresh_token so the /token POST will benefit from this implicit auth object and make the server auth working with Exchange?

cmin764 avatar Jul 06 '22 09:07 cmin764