are you using graph.microsoft.com or your <company>.sharepoint.com as base url in the http begin service for the GET?
Andreas STIHL AG & Co. KG
Original Message:
Sent: Tue June 17, 2025 04:37 AM
From: Ram Chavalam
Subject: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Hi Manual,
Report 302 found, empty primary document.
Thanks
Ram.
------------------------------
Ram Chavalam
Original Message:
Sent: Tue June 17, 2025 04:27 AM
From: Manuel Frank
Subject: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Hi Ram,
what is the status report saying?
And do you see a primary document (MessageFromService) in the GET step?
Best regards
Manuel
Best regards
Manuel
------------------------------
Manuel Frank
Integration Architect
Andreas STIHL AG & Co. KG
Waiblingen
Original Message:
Sent: Tue June 17, 2025 03:57 AM
From: Ram Chavalam
Subject: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Hi Manuel,
Yes, you're right - for the GET request, I'm not using the primary document in Postman. I'm just sending the message to the service URI, and it's working nicely. In Postman, I'm receiving the response as document content, but the same is not happening with the GET method in the actual implementation.
Thanks
Ram.
------------------------------
Ram Chavalam
Original Message:
Sent: Tue June 17, 2025 12:42 AM
From: Manuel Frank
Subject: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Hi Ram,
did you copy the URI from the message to service to Postman and there it works? Very odd.
And there is no new primary docment?
Best regards
Manuel
------------------------------
Manuel Frank
Integration Architect
Andreas STIHL AG & Co. KG
Waiblingen
Original Message:
Sent: Mon June 16, 2025 11:06 AM
From: Ram Chavalam
Subject: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Hi Manuel,
When I try in Postman, I am able to get the content. But when I use the GET method, I don't get an error, and at the same time, I don't receive the file either. Have you encountered this issue?
Thanks
Ram.
Original Message:
Sent: 6/13/2025 6:07:00 AM
From: Manuel Frank
Subject: RE: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Hi Ram,
glad that it works now. The drive id is the unique identifier of the document library.
Best regards
Manuel
------------------------------
Manuel Frank
Integration Architect
Andreas STIHL AG & Co. KG
Waiblingen
Original Message:
Sent: Fri June 13, 2025 04:58 AM
From: Ram Chavalam
Subject: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Hi Manuel,
Thank you so much for your time.
It's working now, but each folder has a unique drive ID. Based on the folder, we need to select the corresponding ID, eliminating the need to pass the main folder. Instead, we can simply pass it as shown below:
<assign to="URI" from="concat('/v1.0/drives/', graph/drive_id, '/root:/Test/testD.txt:/content')"/>
Thanks
Ram.
Original Message:
Sent: 6/12/2025 12:24:00 AM
From: Manuel Frank
Subject: RE: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Hi Ram,
please try it with:
<assign to="URI" from="concat('/v1.0/drives/', graph/drive_id, '/root:/NewDocuments/Test/testD.txt:/content')"/>
Best regards
Manuel
------------------------------
Manuel Frank
Integration Architect
Andreas STIHL AG & Co. KG
Waiblingen
Original Message:
Sent: Wed June 11, 2025 11:25 AM
From: Ram Chavalam
Subject: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Hi Team,
I am able to reach SharePoint, but when I try to retrieve the file, I receive an error message stating "resource not found." However, I am able to access the same file using the SharePoint adapter.
Below is the HTTP GET request for your reference:
<operation name="Http Client Method Service">
<participant name="HTTPClientMethod"/>
<output message="HTTPClientMethodServiceTypeInputMessage">
<assign to="PrimaryDocument" from="graph/mime-document/@*"/>
<assign to="SessionToken" from="string(graph/SessionToken)"/>
<assign to="MethodType">GET</assign>
<assign to="URI" from="concat('/v1.0/drives/', graph/drive_id, '/root:/NewDocuments/Test/testD.txt')"/>
<assign to="RawRequest">true</assign>
<assign to="RawResponse">false</assign>
<assign to="ShowResponseCode">true</assign>
<assign to="ResponseTimeout">300</assign>
</output>
<input message="inmsg">
<assign to="tmp" from="*" append="true"/>
</input>
</operation>
Thanks
Ram.
Original Message:
Sent: 6/6/2025 10:56:00 AM
From: Manuel Frank
Subject: RE: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Hi Andrew,
I am not sure about which type of mailboxes you can connect here.
But one thing which you could try is to change the scope, our auth is working with "https://outlook.office365.com/.default".
Postman:
Best regards
Manuel
------------------------------
Manuel Frank
Integration Architect
Andreas STIHL AG & Co. KG
Waiblingen
Original Message:
Sent: Thu June 05, 2025 08:40 AM
From: Andrew Plumb
Subject: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Thanks Manuel and Vivek. We have an application registered in Entra / Azure.
I was able to pass the request that the Sterling B2B Mail Client is making to obtain an access token through a proxy to see what is the content of the request, and can see that it makes the request to login.microsoftonline.com in the form :
Request Body (ASCII): grant_type=password&client_id=<client_id_value>&client_secret=<client_secret_value>&username=<myuser@domain_value>&password=<password_value>&scope=https://outlook.office365.com/.default
Which I believe is the equivalent of something like:
curl -v -X POST https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=<client_id_value>" \
-d "client_secret=<client_secret_value>" \
-d "grant_type=password" \
-d "username=<myuser@domain_value>" \
-d "password=<password_value>" \
-d "scope=https://outlook.office365.com/.default"
(so I can test the token retrieval outside of Sterling using curl and get the output).
The response in the Sterling B2B Mail client logs indicates a HTTP 400 Bad Request.
The Response from MS includes a little more detail:
Response Body (ASCII): {"error":"invalid_grant","error_description":"AADSTS50126: Error validating credentials due to invalid username or password. Trace ID: d0ab*****a4e00 Correlation ID: 64db2*****8cc89a Timestamp: 2025-06-03 00:17:11Z","error_codes":[50126],"timestamp":"2025-06-03 00:17:11Z","trace_id":"d0abf4****6a4e00","correlation_id":"64db2****4e8cc89a","error_uri":"https://login.microsoftonline.com/error?code=50126"}
(I have masked the ID values in the output)
So it seems to indicate invalid user credentials, but I can login to the Outlook Web App using these credentials, So I believe the credentials are correct, and I have attempted this with passwords with and without special characters (https://www.ibm.com/support/pages/apar/IT41893), so that doesn't seem to be the problem.
From what I can gather, this type of token request where the grant_type=password is referred to as the "ROPC Flow" (Resource Owner Password Credentials Grant), and it appears it may not be compatible with some scenarios, like federated accounts. (https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth-ropc)
I will reach out to IBM support to see if they can confirm this is the case.
------------------------------
Andrew
Original Message:
Sent: Mon June 02, 2025 01:57 AM
From: Manuel Frank
Subject: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Hi Andrew,
as Vivek wrote, you need an app registration first. Usually this is created by the Entra ID admin.
Here's one guide from MS on the needed steps:
https://learn.microsoft.com/en-us/powershell/exchange/app-only-auth-powershell-v2?view=exchange-ps#step-1-register-the-application-in-microsoft-entra-id
The created client id and secret is then used in the property file. Attached a screenshot from our config.
Best regards
Manuel
------------------------------
Manuel Frank
Integration Architect
Andreas STIHL AG & Co. KG
Waiblingen
Original Message:
Sent: Thu May 29, 2025 08:01 PM
From: Andrew Plumb
Subject: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Thanks for the input guys, that clears up regarding the CA certificates.
Another question regarding the IMAP for MS Exchange Online I have is regarding shared mailboxes.
It's not exactly clear to me if the "user" (identified by the username and password entered in the B2B Mail Client adapter, AND as I understand the URI settings within the B2B Mail Client Adapter) must have it's own separately licensed account in Exchange Online, or if it can access a shared mailbox. Apologies if that's not very clear, I'm not very azure/MS Exchange Online literate just yet, but am getting some questions from our email service administrators on this topic...
If anyone has an insight of further details other than what is available on the IBM Sterling Integrator documentation pages, that would be appreciated.
Thanks.
------------------------------
Andrew
Original Message:
Sent: Mon March 17, 2025 04:46 AM
From: Manuel Frank
Subject: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Hi Fabrizio,
for whatever reasons MS has sometimes 2 different certificate for the same endpoint, and with different CAs.
Even with SNI enabled your client receives both of them alternatively, which means you have to have both CAs certificates in the CA store.
Perhaps that is the reason you are getting the halted processes. I check then with openssl if the MS server responds with different certs...
Best regards
Manuel
------------------------------
Manuel Frank
Integration Architect
Andreas STIHL AG & Co. KG
Waiblingen
Original Message:
Sent: Mon March 17, 2025 04:28 AM
From: Fabrizio Allegrini
Subject: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Hi Andrew,
I have had the same problem and often is still there. To resolve i loaded the CA certificate on Sterling B2b Integrator, the name of the certificate is:
- DigiCert Global Root G2 (root)
and you can download it from this site:
https://www.digicert.com/kb/digicert-root-certificates.htm
I have had it from Microsoft support. I alert you that also after this operation the problem is not out completally, because some proceses keep an halted during the night.
------------------------------
Fabrizio Allegrini
Original Message:
Sent: Wed March 12, 2025 06:28 AM
From: Andrew Plumb
Subject: Oauth2.0 for B2B Mail Client in Sterling B2B Integrator
Hi all,
I'd like to use the oauth2 in Sterling B2B Integrator to access the B2B Mail client to retrieve email using IMAP.
The oauth2.properties file doesn't seem to have anywhere to specify the trusted CA certificates to use when connecting to login.microsoftonline.com to obtain an access token. Is there some way to specify trusted CA certificates ?
------------------------------
Andrew
------------------------------