Closed arjunkc closed 2 years ago
You can easily find the tenantID using the m365 cli tool. Once installed, just use the following command:
m365 tenant id get
Why introduce a change that breaks backward compatibility when its not necessary? If you gave the user the option, then there are no issues.
On November 17, 2022 4:16:05 AM EST, "Fr. John Jenkins" @.***> wrote:
You can easily find the tenantID using the m365 cli tool. Once installed, just use the following command:
m365 tenant id get
-- Reply to this email directly or view it on GitHub: https://github.com/UvA-FNWI/M365-IMAP/issues/13#issuecomment-1318323358 You are receiving this because you authored the thread.
Message ID: @.***>
The tenant_id is seemingly necessary when you are connecting to a company provided email when you are not the administrator. You simply can't get a valid token without the tenantId. At least it didn't work until I provided this in the config.py.
I believe the config.py says very clearly that it is optional. I haven't noticed it breaking any backward compatibility and provides more for those who need it.
As far as the documentation concerning tenantId, you are right that the entire Microsoft OAUTH2 stack is horribly complicated and very little is intuitive. I had to work some 3 days to get this working once the company blocked normal authentication. Just thought I would pass on this small bit of info that might save someone some time.
There is a new
config.py
option calledAuthority = "https://login.microsoftonline.com/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/"
which allows one to specify a tenantID. It works if provided. But this breaks older code that does not need a tenantID, and indeed, older versions ofget_token.py
andrefresh_token.py
do indeed work without a tenantID.Shouldn't the code only use the tenantID if provided?
The tenantID/Authority option could also be better documented.