
If you are not concerned with shared mailboxes then you can jump to the second steps and use a personal mailbox in place of the shared mailbox.
#Office 365 support pop imap how to#
S: 535 5.7.This article provides specific instructions on how to set up access to an Office 365 Exchange Online shared mailbox for any contemporary e-mail client or mail application. To authenticate a SMTP server connection, the client will have to respond with an AUTH command in the following format: AUTH XOAUTH2 S: -ERR Authentication failure: unknown user name or bad password. XJlciB5YTI5LnZGOWRmdDRxbVRjMk52YjNSbGNrQmhkSFJoZG1semRHRXVZMj JlciB5YTI5LnZGOWRmdDRxbVRjMk52YjNSbGNrQmhkSFJoZG1semRHRXVZMjl0Ĭ: dXNlcj1zb21ldXNlckBleGFtcGxlLmNvbQFhdXRoPUJlY To authenticate a POP server connection, the client will have to respond with an AUTH command split into two lines in the following format: AUTH XOAUTH2Ĭ: dXNlcj1zb21ldXNlckBleGFtcGxlLmNvbQFhdXRoPUJlYX Sample client-server message exchange that results in an authentication failure:

Sample client-server message exchange that results in an authentication success: Ĭ: A01 AUTHENTICATE XOAUTH2 dXNlcj1zb21ldXNlckBleGFtcGxlLmNvbQFhdXRoPUJlYXJlciB5YTI5LnZGOWRmdDRxbVRjMk52YjNSbGNrQmhkSFJoZG1semRHRXVZMjl0Q2cBAQ= To authenticate a IMAP server connection, the client will have to respond with an AUTHENTICATE command in the following format: AUTHENTICATE XOAUTH2 In case of shared mailbox access using OAuth, application needs to obtain the access token on behalf of a user but replace the userName field in the SASL XOAUTH2 encoded string with the email address of the shared mailbox. SASL XOAUTH2 authentication for shared mailboxes in Office 365 IEV3QkFBbDNCQUFVRkZwVUFvN0ozVmUwYmpMQldaV0NjbFJDM0VvQUEBAQ= dXNlcj10ZXN0QGNvbnRvc28ub25taWNyb3NvZnQuY29tAWF1dGg9QmVhcmVy Note that line breaks are inserted for readability. SASL XOAUTH2 encodes the username, access token together in the following format: base64("user=" + userName + "^Aauth=Bearer " + accessToken + "^A^A")įor example, the SASL XOAUTH2 format to access with access token EwBAAl3BAAUFFpUAo7J3Ve0bjLBWZWCclRC3EoAA is: EwBAAl3BAAUFFpUAo7J3Ve0bjLBWZWCclRC3EoAA^A^A")Īfter base64 encoding, this translates to the following string. OAuth integration with requires your application to use SASL XOAUTH2 format for encoding and transmitting the access token. You can initiate a connection to Office 365 mail servers using the IMAP and POP email settings for Office 365. Your app can get new access tokens as older ones expire. When a user approves the offline_access scope, your app can receive refresh tokens from the Microsoft identity platform token endpoint.

In addition, you can request for offline_access scope.
#Office 365 support pop imap full#
Make sure to specify the full scopes, including Outlook resource URLs, when authorizing your application and requesting an access token. If your application needs persistent access to all mailboxes in a Microsoft 365 organization, we recommend that you use the Microsoft Graph APIs which allow access without a user, enable granular permissions and let administrators scope such access to a specific set of mailboxes. OAuth access to IMAP, POP, SMTP AUTH protocols via OAuth2 client credentials grant flow is not supported. You can use one of our MSAL client libraries to fetch an access token from your client application.Īlternatively, you can select an appropriate flow from the following list and follow the corresponding steps to call the underlying identity platform REST APIs and retrieve an access token. To use OAuth, an application must be registered with Azure Active Directory.įollow the instructions listed in Register an application with the Microsoft identity platform to create a new application.


Learn how to use OAuth authentication to connect with IMAP, POP or SMTP protocols and access email data for Office 365 users.
