Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated Office 365 support? #858

Open
aDingil opened this issue Mar 22, 2023 · 0 comments
Open

Outdated Office 365 support? #858

aDingil opened this issue Mar 22, 2023 · 0 comments
Labels

Comments

@aDingil
Copy link

aDingil commented Mar 22, 2023

馃摚 Notification Service(s) Impacted
Office 365

馃悶 Describe the bug
First awesome project, but i guess i found a bug:
I followed the wiki instructions

  1. The wiki isnt up to date?!
  2. Using a private ms account the tenant id should be set to customers?!
  3. Are business emails supported?
  4. The official ms docs are using an other endpoint
  5. (Un)Encoded client secret doesnt change the outcome
  6. Assuming our {client_secret} is rt/djd/jjd is this specific client secret format needed?

馃挕 Screenshots and Logs
tenant = tenant_id

root@xxxx:# apprise -vvvv -t "Test Message Title" -b "Test Message Body" o365://**tenant_id**:**email**@hotmail.com/**client_id**/**client_secret**
2023-03-22 17:35:30,340 - TRACE - Office 365 URL o365://**tenant_id**:**email**@hotmail.com/**client_id**/**client_secret** unpacked as:
user="**tenant_id**"
password="**email**"
port="None"
host="hotmail.com"
fullpath="/**client_id**/**client_secret**"
path="/**client_id**/"
query="**client_secret**"
schema="o365"
url="o365://**tenant_id**:**email**@hotmail.com/**client_id**/**client_secret**"
qsd="{}"
qsd+="{}"
qsd-="{}"
qsd:="{}"
secure="False"
verify="True"
client_id="**client_id**"
targets="[]"
tenant="**tenant_id**"
secret="**client_secret**"
email="**email**@hotmail.com"
2023-03-22 17:35:30,340 - DEBUG - Loaded Office 365 URL: o365://f...a:**email**@hotmail.com/9...f/****/**email**%40hotmail.com/?format=html&overflow=upstream&rto=4.0&cto=4.0&verify=yes
2023-03-22 17:35:30,341 - DEBUG - Using selector: EpollSelector
2023-03-22 17:35:30,341 - INFO - Notifying 1 service(s) asynchronously.
2023-03-22 17:35:30,342 - DEBUG - Office 365 POST URL: https://login.microsoftonline.com/**tenant_id**/oauth2/v2.0/token (cert_verify=True)
2023-03-22 17:35:30,342 - DEBUG - Office 365 Payload: {'client_id': '**client_id**', 'client_secret': '**client_secret**', 'scope': 'https://graph.microsoft.com/.default', 'grant_type': 'client_credentials'}
2023-03-22 17:35:30,518 - DEBUG - Email To: **email**@hotmail.com
2023-03-22 17:35:30,518 - DEBUG - Office 365 POST URL: https://graph.microsoft.com/v1.0/users/**email**@hotmail.com/sendmail (cert_verify=True)
2023-03-22 17:35:30,518 - DEBUG - Office 365 Payload: {"Message": {"Subject": "Test Message Title", "Body": {"ContentType": "HTML", "Content": "Test Message Body"}, "ToRecipients": [{"EmailAddress": {"Address": "**email**@hotmail.com"}}]}, "SaveToSentItems": "false"}
2023-03-22 17:35:30,518 - DEBUG - Throttling for 0.023922s...
2023-03-22 17:35:30,636 - WARNING - Failed to send Office 365 POST to https://graph.microsoft.com/v1.0/users/**email**@hotmail.com/sendmail: , error=401.
2023-03-22 17:35:30,637 - DEBUG - Response Details:
b'{"error":{"code":"OrganizationFromTenantGuidNotFound","message":"The tenant for tenant guid \'**tenant_id**\' does not exist.","innerError":{"oAuthEventOperationId":"835720e6-0715-4c61-a1bd-e5d2de772cc9","oAuthEventcV":"GDT0LXV34PZesxII6at4vQ.1.1","errorUrl":"https://aka.ms/autherrors#error-InvalidTenant","requestId":"48554b76-b92e-4d0b-8896-c636ae9631f4","date":"2023-03-22T17:35:30"}}}'

tenant == customers

root@xxxx:~/# apprise -vvvv -t "Test Message Title" -b "Test Message Body" o365://consumers:**email**@hotmail.com/**client_id**/**client_secret**
2023-03-22 17:26:39,756 - TRACE - Office 365 URL o365://consumers:**email**@hotmail.com/**client_id**/**client_secret** unpacked as:
user="consumers"
password="**email**"
port="None"
host="hotmail.com"
fullpath="/**client_id**/**client_secret**"
path="/**client_id**/"
query="**client_secret**"
schema="o365"
url="o365://consumers:**email**@hotmail.com/**client_id**/**client_secret**"
qsd="{}"
qsd+="{}"
qsd-="{}"
qsd:="{}"
secure="False"
verify="True"
client_id="**client_id**"
targets="[]"
tenant="consumers"
secret="**client_secret**"
email="**email**@hotmail.com"
2023-03-22 17:26:39,757 - DEBUG - Loaded Office 365 URL: o365://c...s:**email**@hotmail.com/9...f/****/**email**%40hotmail.com/?format=html&overflow=upstream&rto=4.0&cto=4.0&verify=yes
2023-03-22 17:26:39,757 - DEBUG - Using selector: EpollSelector
2023-03-22 17:26:39,757 - INFO - Notifying 1 service(s) asynchronously.
2023-03-22 17:26:39,758 - DEBUG - Office 365 POST URL: https://login.microsoftonline.com/consumers/oauth2/v2.0/token (cert_verify=True)
2023-03-22 17:26:39,758 - DEBUG - Office 365 Payload: {'client_id': '**client_id**', 'client_secret': '**client_secret**', 'scope': 'https://graph.microsoft.com/.default', 'grant_type': 'client_credentials'}
2023-03-22 17:26:39,887 - DEBUG - Email To: **email**@hotmail.com
2023-03-22 17:26:39,887 - DEBUG - Office 365 POST URL: https://graph.microsoft.com/v1.0/users/**email**@hotmail.com/sendmail (cert_verify=True)
2023-03-22 17:26:39,887 - DEBUG - Office 365 Payload: {"Message": {"Subject": "Test Message Title", "Body": {"ContentType": "HTML", "Content": "Test Message Body"}, "ToRecipients": [{"EmailAddress": {"Address": "**email**@hotmail.com"}}]}, "SaveToSentItems": "false"}
2023-03-22 17:26:39,888 - DEBUG - Throttling for 0.071054s...
2023-03-22 17:26:40,039 - WARNING - Failed to send Office 365 POST to https://graph.microsoft.com/v1.0/users/**email**@hotmail.com/sendmail: error=403.
2023-03-22 17:26:40,039 - DEBUG - Response Details:
b'{"error":{"code":"ErrorAccessDenied","message":"Access is denied. Check credentials and try again."}}'

馃捇 Your System Details:

  • OS: Debian 11
  • Python Version: Python v3.9

馃敭 Additional context
I also upgraded to a azure subscription

@aDingil aDingil added the bug label Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant