Unable to fetch auth token. Error: (invalid_client)
See original GitHub issueUpdating a calendar syncing tool I wrote for the new auth system I can’t seem to get it to work. I’ve gone through the app registration steps, I have the app-id and app secret/password with the redirect URL and appropriate graph delegate permissions (superset of scopes list).
I run the script, cut-n-paste the login url into my browser and login. It then redirects me to an outlook.office365.com/owa/ URL which I cut-n-paste back into the terminal at the prompt and I get an error. Script and session copied below.
This is with a freshly created venv using python3.5 (Debian stable) using --system-site-packages
and pip installing o365, icalendar and pylint.
Thanks.
import O365 as o365
creds = ('<snip>', '<snip>')
acct = o365.Account(credentials=creds)
scopes = [
'https://graph.microsoft.com/Calendars.Read',
'https://graph.microsoft.com/Calendars.Read.Shared',
]
result = acct.authenticate(scopes=scopes)
Running this I get (snipped out anything auth/id related)…
(venv) [~]./test.py
Visit the following url to give consent:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?response_type=code&client_id=<snip>&redirect_uri=https%3A%2F%2Foutlook.office365.com%2Fowa%2F&scope=https%3A%2F%2Fgraph.microsoft.com%2FUser.Read+https%3A%2F%2Fgraph.microsoft.com%2FCalendars.Read.Shared+offline_access+https%3A%2F%2Fgraph.microsoft.com%2FCalendars.Read&state=5tUXfvP<snip>&access_type=offline
Paste the authenticated url here: https://outlook.office365.com/owa/?code=OAQABAAIAAACEf<snip>&state=5tUXf<snip>&session_state=f7178db7-<snip>
Unable to fetch auth token. Error: (invalid_client) AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided.
Trace ID: 6452564a-<snip>
Correlation ID: eaa6da0c-<snip>
Timestamp: 2019-01-14 20:34:12Z
Something go wrong. Please try again.
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (8 by maintainers)
Top Results From Across the Web
invalid_client error when requesting an OAuth 2.0 access ...
This error happens when the Token Endpoint Authentication Method is set to client_secret_basic (which is the default method) and the resource ...
Read more >Error: Invalid_Client - What? | Apple Developer Forums
I get the code, identityToken and everything I need - except the call to https://appleid.apple.com/auth/token - because of invalid_client.
Read more >Getting the {"error":"invalid_client"} for access tokens - Help
Hello,. I have integrated the outh2 api for authorization to connect app with other quickbook account and got the code and realmid in...
Read more >Zoho CRM: "Invalid_Client" Error After Successful OAuth ...
The ultimate cause of the issue is actually something that happens directly after the browser authorization. When the redirect to the "OAuth ...
Read more >Uncaught Google_Auth_Exception: Error fetching OAuth2 ...
Fatal error: Uncaught Google_Auth_Exception: Error fetching OAuth2 access token, message: 'invalid_client: Unauthorized' in /web/htdocs/www.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@eikenb hi, we have just released a new version
pip install --upgrade O365
And try againCheck: https://github.com/requests/requests-oauthlib/blob/master/requests_oauthlib/oauth2_session.py#L160
We call
fetch_token
from here.