Skip to Content
0
Mar 18, 2021 at 02:14 PM

SAP BTP Job Scheduling Service - Consume Secured CAP Service

902 Views Last edit Mar 18, 2021 at 02:17 PM 4 rev

Hi Experts,

We have a SAP CAP service with authentication with its own UAA service.

Now, we want to call this service from the SAP BTP Job Scheduler which has its own embedded UAA service.

We have followed the settings defined in section 7.1 of the Job Scheduler documentation to grant the Job Scheduler the required scope to call our service.

SAP Job Scheduling Service

Therefore, in our CAP service xs-security.json we have added the below and we have updated our UAA instance as defined as follows:

1. To grant scopes to SAP Job Scheduling service, open the xs-security.json file that is used for the
xsuaa service instance bound to the application and add the following to the scopes section:
 Sample Code
Example xs-security.json file scope section
"scopes": [{
 "name": "$XSAPPNAME.JOBSCHEDULER",
 "description": "Job Scheduler Scope",
 "grant-as-authority-to-apps": ["$XSSERVICENAME()"]
 }]
2. Update the xsuaa service instance with the updated xs-security.json:
cf update-service  -c xs-security.json

Additionally, we have bind our app with the job scheduling service.

Despite that, we are still getting 401 Unauthorized when trying to call the service from the Job Scheduler.

Any idea about what can be missing?

Thanks in advance.

Regards,

C.