SCIM
tl;dr
Rauthy requires:
- the following SCIM v2 endpoints under
{scim_base_uri}:GET /Users?filter=...POST /UsersGET /Users/{id}PUT /Users/{id}DELETE /Users/{id}withscim.sync_delete_users = trueGET /Groups?filter=...POST /GroupsGET /Groups/{id}PATCH /Groups/{id}withPatchOpDELETE /Groups/{id}withscim.sync_delete_groups = true
- the client to handle
externalIdproperly fitler=externalIdon both{base_url}/Usersand{base_url}/Groupsfilter=userNameon{base_url}/Usersfilter=displayNameon{base_url}/GroupsuserNameto be set properly to the usersemailto match against the DBdisplayto be set properly forScimGroups to match against the DBPatchOps to be working properly onPATCH {base_url}/Groups/{id}replacewill be used for updating the group itselfadd/removeops will be used to modify membership
SCIM Requests
This is just a short section about the SCIM flow Rauthy uses. If you only care about an implementation with Rauthy, you don't need to implement the full SCIM RFC.
As an example, we will go through what happens, when you add SCIM v2 to a client. This will trigger a complete sync which involves all steps. SCIM syncs are also triggered for instance when updating a single user or a group name, but these are sub sets of what will happen during a full client sync. So, let's assume you add a SCIM v2 base URL with enabled Groups sync to a client. It will then do the following requests to the client:
GET {base_url}/Userswith firstfilter=externalIdand if nothing was found, withfilter=userName- If the User exists and should not be synced because of a group prefix filter,
DELETE {base_url}/Users/{id}(scim.sync_delete_users) - If the user does not exist on the client,
POST {base_url}/Usersand create the new user - If it was found by the
GET, update all values and make sureexternalIdis set properly, if it has been found byuserName
- If the User exists and should not be synced because of a group prefix filter,
- Check if Rauthy should sync groups for this client, and skip groups if not
- Get all remote groups via
GET {base_url}/Groupswith optionalfilter=externalIdorfilter=displayName - Compare the
user.groupsfrom remote against the assignments on Rauthys side - Only delete groups on remote if they have a matching
externalIdand should be deleted according to Rauthys config (scim.sync_delete_groups) - If groups don't exist on remote while they should,
POST {base_url}/Groupsto create them - If a match was found by
externalIdwith an outdated name,PATCH {base_url}/Groups{id}to update it properly
- Get all remote groups via
- When Users and Groups exist like they should, make sure Groups assignments are correct. These are done via
PatchOps toPATCH {base_url}/Groups/{id}
These steps cover everything that could happen, apart from a group name update. If this happens, Rauthy will do a
PATCH {base_url}/Groups{id} with the replace setting to replace the groups name / externalId.
If scim.sync_delete_groups / scim.sync_delete_users is disabled, Rauthy will not delete the resources on remote, it
will only remove the externalId value to indicate, that this resource is not managed by Rauthy anymore. This is
important for instance in some scenarios, where you may have important data linked to a user, that you want to keep,
even if the user does not exist anymore.