Available

Provision people with SCIM

Create, suspend and restore people in your project from your identity provider over SCIM 2.0, and keep accounts in your applications current.

SCIM 2.0 (RFC 7644) is a standard that lets one system keep another system's list of people current. Creating and suspending accounts this way is called provisioning.

AuthFI provisions in both directions. Inbound, your identity provider or HR system tells your project who exists. Outbound, your project tells the applications downstream.

Before you begin

You need:

  • A plan that includes SCIM. Without it, the endpoints on this page return 403.
  • An AuthFI project and its issuer, the project's URL. This guide uses https://acme.authfi.io.
  • For inbound provisioning: administrator access to the provisioning settings of your identity provider.
  • For outbound provisioning: an application that accepts SCIM, its SCIM base URL, and the bearer token it gave you.

Provision people from your identity provider

Connect your identity provider or HR system to your project's SCIM endpoint. It then creates, updates and suspends people in your project.

Create a SCIM token

  1. In the console, open Integrations > Applications and select the Provisioning tab.
  2. Choose Generate token. The dialog Inbound SCIM provisioning opens.
  3. Copy the SCIM 2.0 base URL.
  4. Choose a Token lifetime: 1 year (recommended), 180 days, 90 days or 30 days.
  5. Choose Generate token.

The dialog shows the Bearer token. It starts with scim_ and is shown once. Copy it, then tick I have copied the token. The dialog stays open until you do.

export SCIM_TOKEN=<your SCIM token>

Every SCIM token expires. The dialog warns you a month before the token lapses.

A new token replaces the old one

A project has one SCIM token. Rotate token replaces the token your identity provider is using, and the old one stops working at once. Enter the new token in your identity provider straight away. Revoke removes the token.

Configure your identity provider

In your identity provider's provisioning settings, enter these values.

SettingValue
Base URLThe SCIM 2.0 base URL, https://acme.authfi.io/scim/v2
AuthenticationBearer token
TokenThe scim_… Bearer token
Unique identifieruserName, the person's email

Your identity provider appends /Users and /Groups to the base URL itself.

Provision people to an application

When an application accepts SCIM, your project keeps the application's accounts current. The console calls each application you provision to an outbound connector.

  1. In the console, open Integrations > Applications and select the Provisioning tab.
  2. In the Outbound connectors block, choose Connect an application.
  3. Fill in the fields, and register the connector.
FieldEnter
Application nameThe name shown in the list of connectors
Their SCIM base URLThe application's SCIM base URL. https only.
Their API tokenThe bearer token the application gave you

AuthFI seals the token when it arrives, and never shows it again.

The list of connectors shows, for each application, whether the last sends succeeded. To stop provisioning to an application, choose Stop provisioning on its row.

Check that it works

To check inbound provisioning, call your project's SCIM endpoint with the token.

curl https://acme.authfi.io/scim/v2/ServiceProviderConfig \
  -H "Authorization: Bearer $SCIM_TOKEN"

The request succeeds when the base URL and the token are right. Then start provisioning from your identity provider, and look for the people it sends in your project.

To check outbound provisioning, create or change a person in your project. The Outbound connectors block shows whether the send succeeded.

What your identity provider can send

Your project's SCIM endpoint accepts these requests under https://acme.authfi.io/scim/v2.

ResourceOperations
UsersGET, POST, PUT, PATCH, DELETE
GroupsGET, POST, PUT, PATCH, DELETE
/ServiceProviderConfig, /ResourceTypes, /SchemasGET
FeatureValue
PatchYes
FilteruserName eq "…" and externalId eq "…" on Users
Page size20 by default, 100 at most

To find a person, filter on userName or externalId instead of listing everyone.

Create or update a person

Your identity provider creates a person with a POST to the Users resource.

POST

/scim/v2/Users
curl https://acme.authfi.io/scim/v2/Users \
  -H "Authorization: Bearer $SCIM_TOKEN" \
  -H "Content-Type: application/scim+json" \
  -d '{
    "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
    "userName": "[email protected]",
    "externalId": "00u1abcd"
  }'
AttributeRequiredMeaning
userNameYesThe person's email
externalIdYesYour identity provider's ID for the person
activeNoWhether the person may sign in

AuthFI keeps these three attributes from a SCIM user.

The response is 201, and it carries the id that AuthFI gives the person. Sending the same person again answers 409 with scimType uniqueness, as SCIM requires. Identity providers then look the person up and update them.

Suspend and restore a person

Any of these requests suspends a person:

  • DELETE /scim/v2/Users/{id}
  • PATCH with active set to false
  • PUT with active set to false

{id} is the id AuthFI returned when the person was created.

AuthFI keeps the person's account and marks it suspended. It also revokes their sign-in: open sessions end, and refresh tokens stop working.

To restore a person, set active to true.

Send the whole resource on PUT

A PUT replaces the resource. Always include "active": true for a person who should keep access.

Manage groups

A group has a displayName and members.

{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
  "displayName": "engineering",
  "members": [{ "value": "b2f0c6e4-..." }]
}

Each member's value is the id AuthFI returned when that person was created. It is not your identity provider's own ID for them.

What AuthFI sends to an application

AuthFI sends a change to each outbound connector when the change happens in your project.

When, in your projectSent to the application
A person is created or changedThe person is created, or updated if they already exist
A person is suspendedactive: false
A person is deletedDeactivated, or deleted where the application cannot deactivate

A person is sent with these attributes: userName (their email), externalId, active, a given name and a family name, and a primary email.

Troubleshooting

What you seeCauseFix
403 on every SCIM endpointThe plan does not include SCIMChange the plan
401 from a token that used to workThe SCIM token has expiredOn the Provisioning tab, choose Manage token, then Rotate token. Enter the new token in your identity provider.

Next steps