IMAP auth in Office 365 using OAuth2

前端 未结 4 612
难免孤独
难免孤独 2020-11-28 11:06

I\'m using an IMAP client in my program. I\'m trying to access to Office 365 outlook by IMAP client using OAuth2 mechanism (using these instructions.)

When I authent

相关标签:
4条回答
  • 2020-11-28 11:21

    We don't support OAuth for IMAP access to Office 365 and we have no plans to do so as we recommend using our REST APIs to connect to Office 365 for your apps. OAuth is supported for Office 365 REST APIs for mail, calendar and contacts and our older SOAP APIs Exchange Web Services.

    0 讨论(0)
  • 2020-11-28 11:24

    With the new rollout for OAuth 2.0 support for IMAP, I am able to generate the token using the scope

    https://outlook.office365.com/IMAP.AccessAsUser.All

    But I am still getting

    A1 NO AUTHENTICATE failed

    I am using the following properties:

    props.put("mail.imap.ssl.enable", "true"); 
    props.put("mail.imap.auth.mechanisms","XOAUTH2");
    props.put("mail.imap.auth.plain.disable", "true");
    

    EDIT: It is working now !

    0 讨论(0)
  • 2020-11-28 11:40

    We are actively working on OAuth support for IMAP connections to O365 mailboxes. We will make a public announcement once the same is available.

    0 讨论(0)
  • 2020-11-28 11:41

    I got this to work as I described here: Connect to outlook Office 365 IMAP using OAUTH2

    The App Permissions in Azure AD have been moved to the Graph API Section different to the screenshot that was in the comments above. Also the Scope that Azure AD shows did not work for me, I had to use https://outlook.office365.com/IMAP.AccessAsUser

    0 讨论(0)
提交回复
热议问题