Product: SDP

Version: Self-Hosted 1.3.0+ or SaaS

Author: Hélène Zosym


Need

SDP exposes this through the Platform IAM REST API. The reference page for this API is published in the SaaS section of the documentation, and its URLs are written for SaaS. If you copy them as they are on a Self-Hosted installation, you get 404, Realm does not exist, or no response at all.

This article explains how to build the correct URLs for Self-Hosted, which operations are available for users, roles, groups and clients, and the troubleshooting on frequent issues.



Detailed Solution

1. Availability

DeploymentPlatform IAM API
SDP SaaSAvailable
SDP Self-Hosted 1.1.0Not available
SDP Self-Hosted 1.2.0 and laterAvailable



2. Build the base URL for Self-Hosted

The SaaS reference shows URLs such as:

https://{env}.semarchy.net/auth/realms/customer/platform/modules

On Self-Hosted, two parts of this URL change.

Part of the URLIn the SaaS documentationOn Self-Hosted
Host{env}.semarchy.net, the SaaS environment hostYour global domain: the host of the IAM (Keycloak) component, the same value as global.domain in values.yaml. For example sdp.example.com.
Realmcustomer, a placeholder for ​your tenant nameYour site name: global.site_name (matching global.site_id) in values.yaml. The default is selfhosted.

Self-Hosted base URL:

https://<global domain>/auth/realms/<site name>/platform

Example for a default installation on sdp.example.com:

https://sdp.example.com/auth/realms/selfhosted/platform/clients

Two points cause most of the errors:

  • Use the IAM host, not the application host. SDP uses two DNS names: the global domain (sdp.example.com) for IAM, and <site name>.<global domain> (selfhosted.sdp.example.com) for the applications. The Platform IAM API is served from the global domain.
  • The realm is not always selfhosted. It is the site name. If you changed global.site_id / global.site_name, use that value. A quick way to find it: it is the first label of the URL you use to open SDP (https://<site name>.<global domain>).


3. Authentication

Call the API with a bearer token obtained for an API client (service account) of the SDP realm that has the required Platform administration roles. The token is requested from Keycloak on the same host and realm:

POST https://<global domain>/auth/realms/<site name>/protocol/openid-connect/token

Send the token in each request: Authorization: Bearer <access_token>.



4. Operations by object

All paths below are relative to https://<global domain>/auth/realms/<site name>/platform.

ObjectTypical operationsPath
UsersList, create, update/users, /users/{user-id}
User role mappingsList assigned, list available, add/users/{user-id}/role-mappings/realm, /users/{user-id}/role-mappings/realm/available
User groupsAdd a user to a group/users/{user-id}/groups/{group-id} (PUT)
RolesList/roles
GroupsList, create/groups
ClientsList, create/clients

The request and response schemas are the ones in the SaaS reference (replace only the host and realm as described in section 2). Open the matching page on docs.semarchy.com/saas/reference/api/platform/ for the exact body, for example get-clients, get-roles, create-user, update-user.


5. Troubleshooting

SymptomLikely causeAction
404 Not Found on /platform/...URL copied from the SaaS reference: realm customer, or application host instead of IAM hostUse https://<global domain>/auth/realms/<site name>/platform/...
Realm does not existWrong realm nameUse the site name (global.site_name), not customer and not the default if you changed it
404 on every call on 1.1.0API not availableUpgrade to 1.2.0 or later
201 on Create user but "No access assigned"roles in the body is not appliedOption A or B in section 5
GET .../role-mappings/realm returns [] for a new userThis endpoint lists assigned roles onlyCall .../role-mappings/realm/available
401 / 403Token missing, expired, or client without the Platform administration rolesRequest a new token; check the client's roles
500 and nothing in Log ExplorerThe error is not always indexed in Log ExplorerRead the logs of the dm-core-active pod: kubectl logs <dm-core-active pod> -n <namespace>. If you need help, send these logs to Support together with the exact request.