SAP Knowledge Base Article - Public

3743097 - Fail to trigger SAC multi-action API in Datasphere task chain via API task.

Symptom

  • In Datasphere, an API task is created in task chain to trigger SAC multi-action API.
  • API task test run fails with error: “Failed to fetch the access token … Status Code: 401, Status Message: Unauthorized”.
  • Payload in error message: {"error":"unauthorized","error_description":"An Authentication object was not found in the SecurityContext"} or {"error": "invalid_client", "error_description": "Unauthorized grant type"}

Environment

  • SAP Datasphere
  • SAP Analytics Cloud

Reproducing the Issue

  1. Log on to Datasphere tenant and create a generic HTTP connection.
  2. In a task chain, add an API task that calls the multi-actions API via the generic HTTP connection.
  3. Start a test run of the API task.
  4. Observe the test run fails with error: “Failed to fetch the access token … Status Code: 401, Status Message: Unauthorized”. Payload in error message: {"error":"unauthorized","error_description":"An Authentication object was not found in the SecurityContext"} or {"error": "invalid_client", "error_description": "Unauthorized grant type"}

Cause

The cause is OAuth grant type mismatch. SAP Analytics Cloud multi-actions API supports Authorization Code and SAML Bearer (business-user context), while the Datasphere generic HTTP connection only supports Client Credentials (technical-user context). This mismatch prevents token acquisition and results in 401 Unauthorized.

Resolution

Currently SAC multiaction APIs cannot be used in Datasphere task chain. For SAC API, only those supporting Client Credentials grant type can be used in task chain.

See Also

Keywords

SAP Datasphere, SAP Analytics Cloud, 401 unauthorized, failed to fetch access token, oauth, mismatch, client credentials, authorization code, saml bearer assertion, multi-actions api, generic http connection, api task, csrf token, invalid_client, unauthorized grant type, api task, task chain , KBA , DS-DI-SCH , Scheduling and Task Chains , Problem

Product

SAP Datasphere 1.0