This repo contains a minimal SaaS Provisioning Service callback handler that:
- Handles subscribe (
PUT /callback/v1.0/tenants/:tenantId) and unsubscribe (DELETE /callback/v1.0/tenants/:tenantId) - Persists tenant records with soft-delete (
deleted_at) and audit history - Exposes
GET /tenants(platform admin only; scope$XSAPPNAME.PlatformAdmin, delivered via role-collectionS4_Platform_Admin)
npm install
npm run devHealth check:
curl http://localhost:5005/healthThe handler looks for a caller-specified user in (first match wins):
body.subscriptionPayload.adminUserbody.adminUserbody.requestedBybody.user
It stores the raw request body in the audit record (details_json) for proof.
The code includes a best-effort “assign default admin” step via IAS SCIM. If you don't configure SCIM env vars, the app will still provision tenants and audit, but will skip role assignment.
Required env vars:
IAS_SCIM_URL(e.g.https://<tenant>.accounts.ondemand.com/scim/v2)IAS_SCIM_TOKEN_URL(OAuth token endpoint)IAS_SCIM_CLIENT_IDIAS_SCIM_CLIENT_SECRET- Optional:
DEFAULT_ADMIN_GROUP_NAME(default:S4_Admin)
In a real SaaS, mapping an IAS Group to a BTP Role Collection typically requires IAS Group → Role Collection mapping in the subaccount.
Build + deploy:
mbt build
cf deploy mta_archives/s4accelerate-saas-provisioning_1.0.0.mtarBind/register the app in SaaS Provisioning Service with callback base URL:
https://<app-route>/callback/v1.0/tenants/{tenantId}
Unsubscribe uses soft-delete only. Tenant rows remain in DB; deleted_at records when it was deleted.
Retention of ≥ 90 days is supported by design (no hard delete).