Forum Discussion

ledniov's avatar
ledniov
Copper Contributor
May 05, 2020
Solved

Cannot connect to IMAP and SMTP using OAuth2.0 to Exchange Online

Last week the support for IMAP and SMTP using OAuth2.0 has been announced. Following https://docs.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-...
  • ledniov's avatar
    May 17, 2020

    A quote of the Stack Overflow reply from:

    IMAP, SMTP scopes are targeted for Exchange resource and not Graph. Whereas User.Read, Mail.ReadWrite are meant for Graph resource.

    We do not support generation of tokens that are meant for two resources. Hence the error "Provided value for the input parameter scope is not valid because it contains more than one resource."

    You should generate two tokens separately by two calls to /token. 1. One with the IMAP, SMTP scopes generated for the Exchange resource. 2. The other with Graph scopes (User.Read, Mail.ReadWrite) meant for Graph resource.

    https://stackoverflow.com/a/61678485/1126831

Resources