Hi colleagues,
I'm currently trying to call an SAP Build Process Automation API from CAP in order to create a Workflow instance
async createWorkflowInstance(req, definitionId, context) {
const service = await cds.connect.to('spa_workflow');
return service.tx(req).post('/v1/workflow-instances', { definitionId, context });
}<br>
and receive error in logs
The operation that you performed requires principal propagation but you are authenticated with an OAuth grant that cannot be propagated. Please perform this operation with a grant type that contains a user identity.<br>even though my service is annotated with
service CreateRequests @(requires: 'authenticated-user') {<br> and I'm able to see my bearer token via debugger.
The spa_workflow is
"spa_workflow": {
"kind": "rest",
"credentials": {
"destination": "sap_process_automation_service",
"path": "/public/workflow/rest"
}
},<br>
the destination sap_process_automation_service is set as per default instruction
xsuaa is enabled and binded
I already tried to create a destination with type OAuth2JWTBearer - this is how I did it in the past for classical WorkflowManagement - it worked for a while but at some point I had to re-create it - now I always receive an error 401 despite my user has all workflow roles.
Do you have any ideas? Thank you in advance.