Symptom
- HTTP 403 Forbidden error occurs when using SCIM API to create user in SAP Analytics Cloud
- In the returned response body, error message is like the following:
{"timestamp":"yyyy-MM-ddThh:mi:ss.xxx+00:00","status":403,"error":"Forbidden","path":"/api/v1/scim/Users"} - This can happen in the customer python program, which is developed by using the SCIM Rest API.
Environment
SAP Analytics Cloud 2026.8
Reproducing the Issue
- Develop python program to create SAP Analytics Cloud users.
- In the program, develop the code logic as
- Create OAuth client for API Access, User provision
- Follow the guide "Basic Authentication Against the Token Service" section in https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/14cac91febef464dbb1efce20e3f1613/0c1fb5e6ef1f46acb83771070084f124.html to get Access token, CSRF token
- Use the above token values, follow the guide "POST /api/v1/scim/Users" section in https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/14cac91febef464dbb1efce20e3f1613/da3dc52a0fd44da4b727c89d26326af6.html to create user.
- Execute the python program.
- Find it failed in the last POST step and error is HTTP 403 Forbidden.
Cause
The issue is due to the missing cookies in the last request header. After the GET call for fetching x-csrf-token, there are cookies returned in the response header. And these cookies need to be set and reused in the POST call for creating user.
Resolution
- Please refer to this Blog, which contains the sample code to handle cookie headers in GET and POST call: 403 when trying to create user with the SCIM REST API
- Add the similar code logic to get cookies and set the cookies in the POST call http request headers.
See Also
3566761 - SAP Analytics Cloud: Data Import API returns 403 Forbidden Error with a different third-party tool, but returns 201 Created in Postman
Keywords
sac, restful, api, postman, rest, test, py, coding, programing, user, scim2, scim3, groups , KBA , LOD-ANA-LS , Licensing and Full User Equivalent , Problem
Product
SAP Analytics Cloud 1.0
SAP Knowledge Base Article - Public