GearPlug / microsoftgraph-python

Microsoft Graph API wrapper written in Python
MIT License
96 stars 40 forks source link

Incorrect AUTHORITY_URL #5

Closed jkmartindale closed 2 years ago

jkmartindale commented 4 years ago

For some reason AUTHORITY_URL and OFFICE365_AUTHORITY_URL are switched, so that the behavior of the office365 parameter to Client's constructor is the opposite of the expected behavior.

ingmferrer commented 4 years ago

Seems like you're right but I need to test it before making any change.

If you would like to submit a PR, it would be nice.

dhirajpatil19 commented 4 years ago

instead of switching url i tried office365=False and got following error - Specified tenant identifier 'by defect common' is neither a valid DNS name, nor a valid external domain. please help.

jkmartindale commented 4 years ago

Specified tenant identifier 'by defect common' is neither a valid DNS name, nor a valid external domain.

Your problem isn't related to this issue at all, so at least there's an easy fix.

account_type for the Client object corresponds to the tenant GET variable for the API's authorization flow. Valid values include "common", "organizations", and "consumers", among other things. "by defect common" isn't a valid value. "defect" is a typo that's supposed to say "default".

This library defaults to "common", which will work for all personal Microsoft accounts and organization Office 365 accounts. So unless you need to restrict who can use the application, you don't need to specify the account_type variable when constructing Client.