Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP to Microsoft EWS

jakob_steen-petersen
Contributor
0 Kudos
674

Hi experts

Has anyone managed to Connected their ABAP system to Microsoft Exchange Online with the use of oAuth2?

I have tried - but to mee it seems that each user has to logon? Of course that solution is not durable.

What i basiccaly need, is to write a small ABAP program that creates a Calendar entry in a users Outlook.

This has been working without problems until now with Basic Authentification - but that is not allowed anymore (MS decission)

1 ACCEPTED SOLUTION

jakob_steen-petersen
Contributor
0 Kudos
581

Actually did find the solution my self. First i tried the "Standard" way like this:

https://blogs.sap.com/2020/12/18/configuring-oauth-2.0-and-creating-an-abap-program-that-uses-oauth-...

But could´nt get i to work.

So i did the simple way:

First i call https://login.microsoftonline.com/<tenent>/oauth2/v2.0/token?

Providing client_id, scope, client secret and grant type (client_credential)

By this i get an token code

This i use in HTTP header "Authorization" of actual call. Value = Bearer <Token Code>

And of course calls are done with cl_http_client

3 REPLIES 3

Jelena_Perfiljeva
Active Contributor
581

I don't know an answer but there are many SAP/Microsoft enthusiasts in the community, so maybe one of them, like hobruche could help? If you're on Twitter, we have a list there too. And there is this GitHub page.

jakob_steen-petersen
Contributor
0 Kudos
582

Actually did find the solution my self. First i tried the "Standard" way like this:

https://blogs.sap.com/2020/12/18/configuring-oauth-2.0-and-creating-an-abap-program-that-uses-oauth-...

But could´nt get i to work.

So i did the simple way:

First i call https://login.microsoftonline.com/<tenent>/oauth2/v2.0/token?

Providing client_id, scope, client secret and grant type (client_credential)

By this i get an token code

This i use in HTTP header "Authorization" of actual call. Value = Bearer <Token Code>

And of course calls are done with cl_http_client

0 Kudos
578

Always good to hear back you were able to solve and how @jakob_steen-petersen 🙂 did you consider using or at least getting inspired from the ABAP SDK for Azure to integrate with Microsoft Graph API? If not, why?

Also want to make you aware we keep our docs for the support auth setup for Exchange Online and SAP here.

KR Martin