You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to connect to Microsoft Outlook / Exchange
to Microsoft Outlook / Exchange.
I am already getting an access token back.
Unfortunately, I always get the message "connection setup failed"
The error is thrown in the "authenticate" function.
Have you created your service principle and mapped that to the mailbox you are trying to access? The token will authenticate you to Azure/Entra, but it will not give you access to the mailboxes themselves (admittedly the authenticate message is a bit misleading). You must create a service principle and map that as delegate access on the target mailbox(es), much like you would if person A goes on vacation and you want to give user B access to A's mailbox (with your application being "person B"). Note that the Object ID you use here is the one from the Enterprise application in Entra, not the app registration!
See here: #264
Note that the guide above says this: New-ServicePrincipal -AppId <clientId> -ServiceId <objectId>
I recommend this instead: New-ServicePrincipal -AppId <clientId> -ServiceId <objectId> -DisplayName <something sensible>
The reason being that if you look at the mailbox delegation settings seeing a GUID there instead of a name may alarm others on your team. With a sensible display name you can at least tell what it is.
Finally, some areas of the admin panels won't actually show the service principle on the mailbox delegation settings making you think it hasn't worked. Use the full Exchange admin panel, or use the Powershell commands to view your service principles and the mailbox delegation settings.
I am trying to connect to Microsoft Outlook / Exchange
to Microsoft Outlook / Exchange.
I am already getting an access token back.
Unfortunately, I always get the message "connection setup failed"
The error is thrown in the "authenticate" function.
These are some parts of the code, unfortunately I could not find a solution so far.
The text was updated successfully, but these errors were encountered: