Enhancing B2B Mail Client Adapter to access Microsoft Exchange Online with OAuth 2.0
Follow this section to enhance B2B Mail Client Adapter to support IMAP with OAuth 2.0 for Microsoft Exchange Online only.
How the OAuth 2.0 Feature Works
When a work-flow runs to invoke B2B Mail Client Adapter, it will request the Microsoft
Identity Server to get an OAuth access token. Microsoft Identity Server will verify the
credentials and provide the access token. Then, the B2B Mail Client Adapter will request the
Microsoft Exchange Online with the access token and other information to access the
resource. For details, refer to the illustration:
OAuth 2.0 Feature Properties
Field | Description |
---|---|
oauth2_1.class_name | The implementation class for retrieving access token. |
oauth2_1.display_name | The name displayed in the UI for the adapter configuration. |
oauth2_1.provider | The provider of OAuth server. Note: Only
MSExchange is supported.
|
oauth2_1.authorization_endpoint | The URL for the authorization. |
oauth2_1.grant_type | The grant type of OAuth authorization. Note: Only password type is supported.
|
oauth2_1.client_id | The client id for OAuth authorization. |
oauth2_1.client_secret | The client secret for OAuth authorization. |
oauth2_1.scope | The permission scope for OAuth authorization. Note: It must be
https://outlook.office365.com/IMAP.AccessAsUser.All for
MSExchange.
|
oauth2_1.ssl_protocol | SSL protocol |
Client_secret which is used for getting the access token is encrypted and stored in the property file. When read, it is decrypted. Multi factor authentication needs to be turned-off for the user configured for the adapter and for OAuth’s password authorization flow. Refer to the example below for sample configuration:
oauth2_1.class_name = com.sterlingcommerce.woodstock.services.oauth2.OAuth2Authenticator
oauth2_1.config_name = Microsoft Exchange Online
oauth2_1.display_name = Microsoft Exchange Online
oauth2_1.provider = MSExchange
oauth2_1.authorization_endpoint = https://login.microsoftonline.com/<tenantt id>/oauth2/v2.0/token
oauth2_1.grant_type = password
oauth2_1.client_id = <client id of the application defined in Microsoft Azure>
oauth2_1.client_secret = <encrypted client secret generated for the application>
oauth2_1.scope = https://outlook.office365.com/IMAP.AccessAsUser.All
oauth2_1.ssl_protocol = TLS1.2
For more details, refer to Configure the OAuth 2.0 Feature in B2B Mail Client Adapter.