harishkrupo / oauth2ms

Apache License 2.0
72 stars 20 forks source link

O365 Authentication Issues #22

Open frydaho opened 1 year ago

frydaho commented 1 year ago

I've set up oauth2ms according to the instructions provided in steps.org, and I've searched the web for any clues to what I may have done incorrectly. I've spent about 15 hours trying to troubleshoot this, I'm out of ideas, and I would be very grateful to anyone who could help! :)

Every time I execute oauth2ms it opens a browser window and returns a token there, with the message "Authorization complete." Back in the terminal I see this:

tfry@tfryX1:~$ oauth2ms Opening in existing browser session. libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null) Something went wrong during authorization Server returned: {'error': 'invalid_client', 'error_description': "AADSTS700025: Client is public so neither 'client_assertion' nor 'client_secret' should be presented.\r\nTrace ID: 262be02c-ead2-4c32-a8e0-1007dc5ba700\r\nCorrelation ID: 5c9b96da-0533-46c7-b5ca-cdbfdd77f22f\r\nTimestamp: 2022-10-06 17:26:37Z", 'error_codes': [700025], 'timestamp': '2022-10-06 17:26:37Z', 'trace_id': '262be02c-ead2-4c32-a8e0-1007dc5ba700', 'correlation_id': '5c9b96da-0533-46c7-b5ca-cdbfdd77f22f'} Traceback (most recent call last): File "/usr/local/bin/oauth2ms", line 240, in <module> app_state, token = build_new_app_state(crypt) TypeError: cannot unpack non-iterable NoneType object tfry@tfryX1:~$

image

image

My config.json (the XXXs are simply obfuscating stuff):

{ "tenant_id": "9XXXXXX6-3bbd-49b8-a5bc-ecXXXXXX0b8", "client_id": "9XXXXXX5-10e4-4cdb-a13d-21XXXXXXXX71", "client_secret": "gYvXXXXXXXXXXXXXXXXXXXXXXXyfbAy", "redirect_host": "localhost", "redirect_port": "5000", "redirect_path": "/getToken/", "scopes": ["https://outlook.office.com/IMAP.AccessAsUser.All", "https://outlook.office.com/SMTP.Send"] }

image

image

What have I done wrong, and can you point me to next steps in troubleshooting this? Thank you so much in advance!!

kuochang commented 1 year ago

I have the similar issue. The browser page shows "Authorization complete.", but the terminal shows "TypeError: cannot unpack non-iterable NoneType object"

Any clue?

dschwilk commented 1 year ago

@kuochang

I have the similar issue. The browser page shows "Authorization complete.", but the terminal shows "TypeError: cannot unpack non-iterable NoneType object"

What is the url shown in the localhost browser page that states "Authorization complete."? oauth2ms will show "Authorization complete" even if no token is returned because one of the scope urls is incorrect. I don't think that explains @frydaho 's problems it it might explain your's. Caveat: I am stumbling through this myself but do have both imap and smtp now working on outlook.office365.com

legalnonsense commented 1 year ago

Is there a token saved in ~/.local/share/oauth2ms?

urugang commented 3 months ago

same problem. follow below instructions, it worked. https://stackoverflow.com/questions/73102294/aadsts9002331-application-is-configured-for-use-by-microsoft-account-users-only