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

SAP Identity Directory API not working from RAP & CAP

Bhavik2
Explorer
0 Likes
450

Hello,

We have a requirement to create Users in SAP BTP whenever the supplier registers with email id. For this SAP has provided Identity Directory API Overview | Identity Directory API | SAP Business Accelerator Hub

In above link I want to use Users.

Bhavik2_1-1742575624636.png

Below is the destination set up

Bhavik2_0-1742575526483.png

We are trying to call API from ABAP on Cloud and CAPM but it is failing in both cases below are the details.

From ABAP on Cloud:

Bhavik2_3-1742576516267.png

 

When trying option 1 and 2 we are getting below error.

"401","detail":"Authentication credentials are invalid or not allowed for this endpoint."

CAPM:

Bhavik2_4-1742576576232.pngBhavik2_5-1742576665752.pngBhavik2_6-1742576732135.png

After deploying to cloud foundry we get below error.

Bhavik2_7-1742576887341.pngBhavik2_8-1742576944058.png

 

Bhavik2_9-1742576971775.png

We get below error.

Bhavik2_10-1742577043695.png

 

Surprisingly when we try from Postman hub it is working fine.

Bhavik2_11-1742577161794.png

 Can anyone help?

 

 

 

 

 

 

Accepted Solutions (0)

Answers (1)

Answers (1)

thomaswiegand
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi,

I can only comment for ABAP Cloud (not CAP), but as you are consuming a OAuth 2.0 Client Credentials Destination, you have to use i_authn_mode = service_specific in your create_by_cloud_destination call (SAP Help).

As I assume that you use destinations on subaccount level, you should also omit the service_instance_name

In general, if there is no particular reason for you to use a BTP destination in your ABAP code, I would recommend to use local configuration based on the communication target and communication management (SAP Help).

Best Regards

Thomas