IBM Support

Using the B2B Mail Client Adapter with OAuth 2.0 enabled to access Microsoft Outlook.office365.com and receive error "Failed to get an access token, HTTP response error code 401"

Troubleshooting


Problem

Using product B2B Integrator (B2Bi), B2B Mail Client Adapter with OAuth 2.0 enabled attempts to access Microsoft Outlook.office365.com and received Failed to get an access token, HTTP response error code 401

This session utilize the enhanced B2B Mail Client Adapter to access Microsoft Exchange Online with OAuth 2.0, configured with adapter properties Default Message Access Protocol set to IMAP, Default Mail Server Port 993, and SSL=Must using TLS1.2 protocol.


Symptom

The execution of the Business Process fails on the B2B Mail Client adapter step, Status - Error.

The b2bmailclient.log post:
[2022-08-08 15:36:00.667] ERROR Failed to get an access token
[2022-08-08 15:36:00.667] ERROR [1659987360667] Server returned HTTP response code: 401 for URL: https://login.microsoftonline.com/b5da5f35-5678-3232-9622-123456789012/oauth2/v2.0/token
[2022-08-08 15:36:00.667] ERRORDTL [1659987360667]java.io.IOException: Server returned HTTP response code: 401 for URL: https://login.microsoftonline.com/b5da5f35-5678-3232-9622-123456789012/oauth2/v2.0/token
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1912)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1510)
at com.ibm.net.ssl.www2.protocol.https.b.getInputStream(b.java:1)
at com.sterlingcommerce.woodstock.services.oauth2.OAuth2Authenticator.getAccessToken(OAuth2Authenticator.java:146)
at com.sterlingcommerce.woodstock.services.oauth2.OAuth2Util.getAccessToken(OAuth2Util.java:111)
at com.sterlingcommerce.woodstock.services.b2bmailsvs.AccessMailJ.connect(AccessMailJ.java:291)
at com.sterlingcommerce.woodstock.services.b2bmailsvs.SimpleMailClient.processData(SimpleMailClient.java:109)
at com.sterlingcommerce.woodstock.workflow.activity.engine.ActivityEngineHelper.invokeService(ActivityEngineHelper.java:1826)
at com.sterlingcommerce.woodstock.workflow.activity.engine.ActivityEngineHelper.nextMainLogic(ActivityEngineHelper.java:631)
at com.sterlingcommerce.woodstock.workflow.activity.engine.ActivityEngineHelper.next(ActivityEngineHelper.java:362)
at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.doWork(WorkFlowQueueListener.java:459)
at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.run(WorkFlowQueueListener.java:240)
at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.onMessage(WorkFlowQueueListener.java:197)
at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.onMessage(WorkFlowQueueListener.java:184)
at com.sterlingcommerce.woodstock.workflow.queue.wfTransporter.run(wfTransporter.java:447)
at com.sterlingcommerce.woodstock.workflow.queue.BasicExecutor$Worker.run(BasicExecutor.java:508)
at java.lang.Thread.run(Thread.java:818) 

Document Location

Worldwide


[{"Type":"MASTER","Line of Business":{"code":"LOB59","label":"Sustainability Software"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SS3JSW","label":"IBM Sterling B2B Integrator"},"ARM Category":[{"code":"a8m0z0000001ilTAAQ","label":"System Administration-\u003EAdapters and Services-\u003EB2B Mail Client"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"6.0.3;6.1.0"}]

To view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use the link to actual document below to access the full document. You will be asked to log on if you are not already logged in. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Historical Number

L3REQ-36432

Document Information

More support for:
IBM Sterling B2B Integrator

Component:
System Administration->Adapters and Services->B2B Mail Client

Software version:
6.0.3, 6.1.0

Document number:
6613551

Modified date:
18 August 2022

UID

ibm16613551

Manage My Notification Subscriptions