A role can come from the identity provider: a SAML group value in the sign-in assertion, or a SCIM group pushed by the directory. Assignments made this way have source saml or scim and can't be changed through the role assignment endpoints (409 managed_by_idp). Both endpoints take the app key.
Get the mapping#
The SAML connection's group mapping and the SCIM groups, with the role each gives.
GET
/v1/apps/:app_id/authz/idpApp keyRequestbash
curl https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/idp \ -H "Authorization: Bearer $SCUTE_APP_SECRET"Response 200json
{ "saml": { "connected": true, "enabled": true, "editable": true, "groups_attribute": "groups", "default_role": "viewer", "groups": [ { "group": "Finance", "role": "billing_admin" } ] }, "scim": { "connected": true, "groups": [ { "id": "0193f9d0-1111-7222-8333-444444444444", "display_name": "Support", "external_id": "a1b2c3", "members": 12, "mapped": true, "role": "support" } ] }}editable is false when SAML is set up on a master workspace above; then refused_code is saml_master_only and the mapping is changed there.
Set the groups for a role#
Send saml, scim_group_id, or both.
PUT
/v1/apps/:app_id/authz/roles/:slug/idp-groupsApp keyslugstringrequired
Path. The role.
samlstring[]
Replaces the SAML group values that give this role. At most 100.
forceboolean
Move a SAML value that already gives another role to this one.
scim_group_idstring
The SCIM group whose members get this role.
Requestbash
curl -X PUT https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/roles/billing_admin/idp-groups \ -H "Authorization: Bearer $SCUTE_APP_SECRET" \ -H "Content-Type: application/json" \ -d '{ "saml": ["Finance", "Accounting"] }'Response 200json
{ "role": "billing_admin", "idp_groups": { "saml": ["Accounting", "Finance"], "scim": null }, "saml_applies": "next_sign_in"}SAML changes apply at each person's next sign-in.
| Status | error_code | When |
|---|---|---|
| 404 | not_found | No such role, or no SCIM group with that ID |
| 409 | saml_not_connected | No SAML connection signs people in to this app |
| 409 | group_mapped_elsewhere | A SAML value already gives another role. Send force: true to move it. detail maps each value to the role it gives now |
| 409 | role_has_scim_group | The role already comes from another SCIM group |
| 403 | saml_master_only | SAML is set up on the master workspace. Change the mapping there |
| 422 | invalid | Neither key sent, saml is not a list of strings, more than 100 values, or an empty scim_group_id |