harishkrupo / oauth2ms

Apache License 2.0
75 stars 24 forks source link

Problem configuring URLs for Office365 #15

Closed agenbite closed 1 year ago

agenbite commented 2 years ago

While trying to configure oauth2ms, I get the following error after authenticating in my office365 server: AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: '20460e5d-ce91-49af-a3a5-70b6be7486d1'.

This is with the following values in the config (I'm using Evolution's client id, and it works in other scripts like mutt_oauth2):

   {
        "tenant_id": "common",
        "client_id": "20460e5d-ce91-49af-a3a5-70b6be7486d1",
        "client_secret": "",
        "redirect_host": "localhost",
        "redirect_port": "5000",
        "redirect_path": "/GetToken/",
        "scopes": ["https://outlook.office365.com/IMAP.AccessAsUser.All", "https://outlook.office365.com/SMTP.Send"]
   }

I'm confused about the redirect uri: shouldn't it be something like https://login.microsoftonline.com/common/oauth2/nativeclient? This is what mutt_oauth2 uses. But then, I don't have a port or a path...

Thanks in advance!

gartrog commented 1 year ago

Hello @agenbite . I get exactly the same error. Did you ever manage to solve it ?

agenbite commented 1 year ago

No, I did not. Sorry. I managed to solve my setup with mutt_oauth2, however.

lahwaacz commented 1 year ago

Just to note: Evolution's client ID works only with the authcode workflow of mutt_oauth2.py where the code is returned as part of the URL and must be copied manually back into the terminal. The localhostauthcode does not work - it leads to the redirect_uri mismatch error.