API reference

Master Entra app

Save a Master workspace's own Entra app, and switch it from a client secret to a federated credential.

A Master workspace can hold one Entra app registration that every MSP and client under it uses. Saved here, it proves itself to Microsoft with a federated credential (no stored secret) or a client secret. These calls work on Master workspaces only.

Authenticate with the Master's workspace key in Authorization and an M2M token from an app in the Master workspace in X-Authorization. A member JWT also works in X-Authorization: any member may read, and testing or saving takes an owner or admin (403 workspace_admin_required). See Authentication.

Federated credential#

With a federated credential, Microsoft accepts a short assertion that Scute signs in place of a password. Scute stores no secret for the app. The signing key is held in a KMS and cannot be exported. Add the credential on the app registration under Certificates and secrets, Federated credentials, Add credential, scenario Other issuer:

FieldValue
Issuerhttps://api.scute.io/entra-federation
Subject identifierworkspace: followed by the Master workspace UUID (not its slug)
Audienceapi://AzureADTokenExchange

The three values are in federation of Get the Master app. The same credential covers GDAP connections made on the Master's app.

To move an app that runs on a client secret: add the federated credential next to the secret in Azure, test it against a client tenant, switch, send a push to check, then delete the old secret in Azure.

Errors on these calls:

Statuserror_codeWhen
401Missing key, or no M2M token or member JWT in X-Authorization.
403The key or token belongs to another workspace.
403not_a_master_workspaceThe path workspace is not a Master.
404No workspace with that id or slug.
422missing_tenant_idtenant_id is missing on a federated test or save.
422missing_credentialsNo client_id and none saved yet, or a secret save without client_id and client_secret.
422federation_unavailableThe deployment has no signing key for federated credentials yet.
422invalid_credential_typecredential_type is not secret or federated (the test takes federated only).
422handshake_failedMicrosoft refused the federated credential. Save only.

When Microsoft refuses, microsoft_code says why:

microsoft_codeMeaning
AADSTS70025The app has no federated credential.
AADSTS70021No federated credential on the app matches the three values.
AADSTS700211The issuer differs.
AADSTS700212The audience differs.
AADSTS700213The subject identifier differs.

Get the Master app#

Returns the saved app, the federated credential values, the redirect URIs the app registration needs and how many clients use the app. A secret is never returned.

GET/v1/workspaces/:workspace_id/entra/master-appWorkspace key + M2M token
workspace_idstringrequired
Master workspace UUID or slug.
Requestbash
curl https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/master-app \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"
Response 200json
{  "workspace": { "id": "0193f8aa-0000-7000-8000-000000000000", "slug": "acme-master", "name": "Acme" },  "app": {    "configured": true,    "client_id": "3c1d2e4f-0a9b-4c8d-9e7f-112233445566",    "credential_type": "secret",    "legacy_settings_credentials": false  },  "federation": {    "available": true,    "issuer": "https://api.scute.io/entra-federation",    "subject": "workspace:0193f8aa-0000-7000-8000-000000000000",    "audience": "api://AzureADTokenExchange"  },  "redirect_uris": [    "https://api.scute.io/v1/auth/entra/auth-oidc",    "https://api.scute.io/v1/auth/entra/admin-consent-callback"  ],  "tenant_id": null,  "clients_using": 42}

app.credential_type is secret, federated or null when no app is saved. clients_using counts the connected workspaces under the Master that run on the app the tree resolves to (scute_managed).

Test the federated credential#

Asks Microsoft for a token at any tenant with the federated credential. Nothing is saved. Run it against a client's tenant before you switch. Answers 200 with ok: true or ok: false.

POST/v1/workspaces/:workspace_id/entra/master-app/testWorkspace key + M2M token
workspace_idstringrequired
Master workspace UUID or slug.
tenant_idstringrequired
Any tenant: the app's own or a client's.
client_idstring
The app's client ID. Defaults to the saved one.
credential_typestring
federated (default). Nothing else can be tested here.
Requestbash
curl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/master-app/test \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \  -H "Content-Type: application/json" \  -d '{ "tenant_id": "c87af060-e83b-4ed4-bf27-1d6ac3584c90" }'
Response 200json
{  "ok": false,  "tenant_id": "c87af060-e83b-4ed4-bf27-1d6ac3584c90",  "steps": [    { "id": "input", "ok": true },    { "id": "token", "ok": false, "message": "...", "microsoft_code": "AADSTS70021" }  ],  "warnings": [],  "error": "...",  "microsoft_code": "AADSTS70021"}

Save the Master app#

Saves or switches the Master's app. With credential_type: "federated", Scute first asks Microsoft for a token with the federated credential, and saves the app and drops the stored secret only when Microsoft accepts it. With a client secret, Microsoft is not contacted: send a push afterwards to check it.

PUT/v1/workspaces/:workspace_id/entra/master-appWorkspace key + M2M token
workspace_idstringrequired
Master workspace UUID or slug.
credential_typestring
secret (default) or federated.
client_idstring
The Application (client) ID. Required for a secret. For federated it defaults to the saved one.
client_secretstring
Required for a secret. Stored encrypted and never returned. Send a new one to rotate it.
tenant_idstring
Required for federated: the tenant the handshake runs against.
Requestbash
curl -X PUT https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/master-app \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \  -H "Content-Type: application/json" \  -d '{ "credential_type": "federated", "client_id": "3c1d2e4f-0a9b-4c8d-9e7f-112233445566", "tenant_id": "c87af060-e83b-4ed4-bf27-1d6ac3584c90" }'

The response is the state from Get the Master app plus changed (whether anything was written) and, for federated, handshake:

Response 200json
{  "workspace": { "id": "0193f8aa-0000-7000-8000-000000000000", "slug": "acme-master", "name": "Acme" },  "app": { "configured": true, "client_id": "3c1d2e4f-0a9b-4c8d-9e7f-112233445566", "credential_type": "federated", "legacy_settings_credentials": false },  "federation": { "available": true, "issuer": "https://api.scute.io/entra-federation", "subject": "workspace:0193f8aa-0000-7000-8000-000000000000", "audience": "api://AzureADTokenExchange" },  "redirect_uris": ["https://api.scute.io/v1/auth/entra/auth-oidc", "https://api.scute.io/v1/auth/entra/admin-consent-callback"],  "tenant_id": null,  "clients_using": 42,  "handshake": { "ok": true, "tenant_id": "c87af060-e83b-4ed4-bf27-1d6ac3584c90", "steps": [{ "id": "input", "ok": true }], "warnings": [] },  "changed": true}

A refused handshake returns 422 with the test result and error_code handshake_failed. Nothing changes.

Set credentials (older call)#

The earlier call for the same record. It writes the same fields and returns a short answer.

PATCH/v1/workspaces/:workspace_id/entra/credentialsAPI key + M2M token
workspace_idstringrequired
Master workspace UUID or slug.
client_idstringrequired
The Application (client) ID.
client_secretstring
Required unless credential_type is federated.
credential_typestring
federated runs the handshake first. Anything else saves a secret.
tenant_idstring
The tenant for the federated handshake. Defaults to the workspace's connected tenant.
Requestbash
curl -X PATCH https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/credentials \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \  -H "Content-Type: application/json" \  -d '{ "client_id": "3c1d2e4f-0a9b-4c8d-9e7f-112233445566", "client_secret": "..." }'
Response 200json
{ "ok": true, "credentials_set": true, "credential_type": "secret" }

The M2M token's app has to be in the Master workspace. Errors: 403 not_a_master_workspace, 422 missing_credentials, 422 federation_unavailable, 422 handshake_failed.

Issuer endpoints#

Microsoft reads these to verify the assertions Scute signs. They are public and cached for an hour.

Get the issuer configuration#

GET/entra-federation/.well-known/openid-configurationNone
Requestbash
curl https://api.scute.io/entra-federation/.well-known/openid-configuration
Response 200json
{  "issuer": "https://api.scute.io/entra-federation",  "jwks_uri": "https://api.scute.io/entra-federation/jwks.json",  "response_types_supported": ["id_token"],  "subject_types_supported": ["public"],  "id_token_signing_alg_values_supported": ["RS256"]}

Get the issuer keys#

Returns the public key. The key set is empty while the deployment has no signing key.

GET/entra-federation/jwks.jsonNone
Requestbash
curl https://api.scute.io/entra-federation/jwks.json
Response 200json
{  "keys": [    { "kty": "RSA", "kid": "...", "use": "sig", "alg": "RS256", "n": "...", "e": "AQAB" }  ]}