Unable to authentication using app id and secret
See original GitHub issueInstead of using delegated authentication, I have a registered app with application permissions assigned to it.
The app has admin consent already applied it’s permissions.
This is the sample code that I am using that is causing the below two problems:
from O365 import Account
credentials = ('my_client_id', 'my_client_secret')
# the default protocol will be Microsoft Graph
account = Account(credentials, auth_flow_type='credentials')
if account.authenticate():
print('Authenticated!')
When I try to use Account
class to get a token, I run into two problems.
- When using application permissions, the documentation mentions I don’t need to specify any scopes. If I don’t specify any scopes, I get this error:
Traceback (most recent call last):
File "/Users/****/Documents/office_365/token_manager.py", line 51, in generate_app_token
if account.authenticate():
TypeError: authenticate() missing 1 required keyword-only argument: 'scopes'
- In order to bypass the issue#1, I passed in default scope. This time, the method
account.authenticate
print’s a URL that I have to visit in order to give consent. If I understand this correctly, the URL for consent should only be needed when using “on behalf of the user” authentication method.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Using Terraform Unable to authenticate my app via vs code ...
Using Terraform Unable to authenticate my app via vs code even after giving the right subscription ID, tenant ID, client ID and client ......
Read more >"Invalid client ID or secret" error when connecting to OAuth ...
Describes the cause of "Invalid client ID or secret" error when connecting to Precisely's OAuth Token Service This can be caused by an...
Read more >Resolve Amazon Cognito “Unable to verify secret hash for ...
When I try to invoke my Amazon Cognito user pools API, I get an "Unable to verify secret hash for client <client-id>" error....
Read more >Error "unauthorized_client" when using Microsoft as ... - GitHub
We're unable to complete your request unauthorized_client: The client does not exist or is not enabled for consumers. If you are the application ......
Read more >The connection test of the OAuth 2.0 integration fails with the ...
the Client ID field should be set to the Application (client) ID from application created in the Azure portal; the Client Server field...
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
Can you check now? version 2.0.3 is on pypi with the fix
Verified 2.0.3 works with application ID and application secret along with a custom tenant. Thanks again @janscas 😃