cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to set up OAuth 2.0 for SAP Service Cloud and OData API

former_member725697
Discoverer
3,727

Hi, I'm building an integration with SAP Service Cloud. My server application is going to use OData API to access SAP resources. I would like to use OAuth 2.0 to authenticate my clients with SAP in order to get an access token to communicate with API on their behalf. Access token should also be refreshed regularly without client intervention.

I'm new to SAP ecosystem and struggling to figure out how to configure OAuth 2.0 for the scenario above. I only have SAP Service Cloud account. While reading help article https://help.sap.com/viewer/ea72206b834e4ace9cd834feed6c0e09/Cloud/en-US/ba893b5161d34760989429c24b2... I've got an impression that I should also have an SAP Cloud Platform account where I will register my server application to be able to authenticate and communicate with API on client's behalf.

Could you please confirm my assumption? Is it possible to implement OAuth 2.0 flow with SAP Service Cloud account only?

Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

former_member725697
Discoverer
0 Likes

It seems that OData API doesn't support classic OAuth 2.0 flow: https://github.com/SAP/C4CODATAAPIDEVGUIDE#authentication

As an alternative I'm going to use 'OAuth SAML bearer flow'. For that I need to request a token from C4C platform.

Answers (1)

Answers (1)

former_member226
Employee
Employee
0 Likes

Hello,

Based on my experience, C4C prefers Basic as well as Client Certificate-based authentication and for these, you do not need any explicit configuration for trust establishment.

In case you want to authenticate your client with an OAuth 2.0 flow for C4C OData communication then you need to have an OAuth Identity provider who can authenticate the incoming user. By standard SAP provides OAuth mechanism via SCP hence following article talks about the same:

https://help.sap.com/viewer/ea72206b834e4ace9cd834feed6c0e09/Cloud/en-US/929294823bc44614ba2034662f0... --> For Neo

https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/1150e4395ba6487bad2a7164db7... --> For Cloud Foundary

However they are not just restrcited to this but you can use any other OAuth Identity Provider as well like Okta or MS ADFS but the procedure for et will remain the same i.e. register a OAuth server for authentication and register OAuth Client for OData Access,

vinod_c4c
Explorer
0 Likes

Hi Saurabh,

Do you have any idea on how to integrate SAP C4C with SAP DWC (Data Warehouse Cloud) using Oauth?

Scenario: SAP DWC pulls the data from SAP C4C

Services: ODATA services(business objects & data sources) in SAP C4C.

Could you please let me know the recommended ways to integrate SAP C4C and SAP DWC.

Thank you!

Vinod.