Skip to content

SCIM provisioning

Let your customer’s directory, such as Microsoft Entra ID or Okta, create, change, deactivate and reactivate the accounts of a realm or of an organization over SCIM 2.0, with the token of a connection.

With SCIM provisioning, your customer’s directory keeps the Authio accounts up to date on its own: whoever joins the company gets an account, whoever changes name or e-mail is updated and whoever leaves is deactivated, with nobody opening the console. Microsoft Entra ID and Okta speak SCIM 2.0 (RFC 7643 and RFC 7644) and call Authio with the token of a SCIM connection.

Authio’s SCIM is inbound only: the directory writes, and Authio never reads from or sends anything to the directory. A connection belongs either to a realm, for the directory that looks after all of its accounts, or to an organization, for the directory of a B2B customer that looks after its own people only.

How it works

Each connection has a base URL and a token. The base URL is the API’s address followed by one of these paths, and the console shows it ready to copy:

ConnectionBase URL path
Of the realm/realms/{realm}/scim/v2
Of an organization/realms/{realm}/organizations/{handle}/scim/v2, with the organization’s handle, case-insensitive

The directory calls the base URL with the token in the Authorization: Bearer header. The token works only at its own connection’s base URL and opens no other route of the API. Under the base URL, Authio answers:

EndpointWhat it does
GET /UsersLists the accounts the connection reaches, in pages of up to 100, with an optional filter; see Limits.
POST /UsersCreates an account without a password, or brings back one the connection deprovisioned, and answers 201.
GET /Users/{id}Reads an account, by its Authio ID.
PUT /Users/{id}Replaces the account’s attributes. Without active in the body, the account stays as the connection sees it.
PATCH /Users/{id}Applies add, replace and remove operations, all of them or none. Booleans written as text, like the "False" Entra sends, are accepted.
DELETE /Users/{id}Deprovisions the account without deleting it and answers 204; see Deactivate or delete.
GET /ServiceProviderConfig, /ResourceTypes, /SchemasDiscovery: patch supported; bulk, sorting, ETags and password change not supported; filters with up to 100 results; bearer token authentication (oauthbearertoken); and the User schema with only the attributes accepted.
  • Only the `Users` resource. There are no groups and no bulk operations: /Groups, /Bulk and /Me answer 404. Turn off group provisioning in the directory.
  • The attributes read are userName (required), externalId, name.givenName, name.familyName, displayName, emails and active. The name comes from name, or else from displayName, or else from userName; the e-mail is the primary item, or else the one of type work, or else the first. The password and every other attribute, the enterprise extension’s included, are ignored.
  • `externalId` is kept per connection. Two connections can keep different values for the same account, and neither sees the other’s.
  • Only end-user accounts of the realm. No connection reaches console accounts, accounts of another realm or deleted ones, and an account out of reach answers as if it did not exist.
  • Accounts created are born without a password, active (unless they come with active false), with access to the connection’s clients. They count toward the plan’s user quota.
  • Webhooks. A created account publishes user_created, and a change, deactivating and reactivating included, publishes user_updated, to the realm’s endpoints; see Webhooks.
  • Format. Answers are written in application/scim+json, and requests may come in application/scim+json or application/json.
Look a person upBash
curl "https://authio.api.hyperio.tech/realms/acme/scim/v2/Users?filter=userName%20eq%20%22ana%40contoso.com%22" \
  -H "Authorization: Bearer $SCIM_TOKEN"

Plan and dedicated environment

On the shared platform, the plan of the account that owns the realm has to include SCIM provisioning, and the subscription has to be in force. Without the capability, creating a connection, rotating its token and every call from the directory answer 403 with ScimProvisioningNotIncluded (with the subscription suspended, IntegrationLicenseSuspended). Nothing is deleted: the connections go quiet and work again on a plan that includes the capability. In a dedicated environment, the capability holds for the whole instance, with no plan check.

The platform realm, the console’s own, accepts no connections (ScimConnectionRealmNotAllowed), and the section does not show on its page.

Create a connection

  1. Open the section

    For a realm, open its page in Realms, Integrations tab, SCIM provisioning section. For an organization, open its page in Organizations, People tab, SCIM provisioning section. Choose New SCIM connection.

  2. Fill in the connection

    FieldWhat it takes
    NameRequired, up to 100 characters. The trail shows the name as the author of what the directory changes.
    Identity provider to pre-linkOptional. The provider people will sign in through: every account the directory creates or changes is linked to it; see Pre-linking. In an organization, only the providers offered to it are listed.
    Attribute carrying the subjectexternalId (the default) or userName: the SCIM attribute that carries the identifier the provider authenticates the person with. See Okta and Entra over OIDC.
    ClientsOptional. The realm’s clients, by client ID, that every provisioned account is given access to, so it can sign in to a client with Restrict to linked accounts. With none, the accounts belong to the realm and do not reach those clients.
  3. Copy the base URL and the token

    Create connection shows the base URL and the token once, each with its own copy button. The token starts with scim_, followed by 43 letters and digits, and Authio keeps only a fingerprint of it, so there is no reading it again: if you close without copying, rotate the token to see a new one. Someone without secret:read creates the connection but does not see the token.

  4. Set up the directory

    Paste the base URL and the token in the directory’s provisioning settings: see Microsoft Entra ID and Okta.

The token is worth an account administrator

A connection of the realm reaches every end-user account of the realm. With the token, the directory creates, changes and deactivates any of them and, with a pre-linked provider, links any of them to a subject of that provider, which then signs in to it. Keep the token only in the directory, rotate it when somebody who saw it leaves and revoke the connection at the first sign of a leak. For a B2B customer, prefer a connection of the organization, which reaches only its people.

In the section, each connection shows its status, its provider and its last use, to the minute. The side panel brings the base URL, the clients, the accounts the connection keeps today and, for whoever reads the trail (audit:read), the directory’s recent changes. The console shows only the actions you can use:

ActionWhat it doesPermission
New SCIM connectionCreates the connection and shows the token once.realm:write and secret:write
EditChanges the name, the provider, the subject attribute and the clients of an active connection. The organization does not change. The change holds for what the directory sends from then on: links, access and memberships already recorded stay as they are.realm:update
Rotate tokenIssues a new token and shows it once, with the base URL, which does not change. The previous one can keep working for up to a day, the bound of the environment’s rotation policy, so you can switch it in the directory without an outage. A new rotation drops the previous one, so at most two tokens work at once.realm:update and secret:write
RevokeThe current token and the previous one stop working on the next call. It is final: provisioning again takes a new connection. The accounts, sign-in links and memberships it created stay as they are.realm:delete
DeleteOnly for a revoked connection: it leaves the list, with the externalId values it kept. The accounts, sign-in links, client access and memberships stay.realm:delete

Seeing the connections takes realm:read. On a plan without the capability, the console shows a notice and hides creating and rotating, but revoking and deleting remain available. Deleting an organization deletes its connections, and the accounts stay in the realm.

Every change the directory makes (POST, PUT, PATCH and DELETE), accepted or refused, goes in the realm’s change trail with the connection as its author, by its name and with the SCIM tag, the User resource type and the account it touched. The trail keeps neither the request body nor the token, and reads do not go in it. Creating, editing, rotating, revoking and deleting a connection are recorded too, in the name of whoever did it, with the ScimConnection resource type.

The connections are in the admin API too. On Node.js, @hyper.authio/admin calls them as admin.scimConnection.getAll, getById, create, update, rotate, revoke and delete (see The Admin API from the libraries); on .NET, where IAuthioAdminClient has no method for them, an HttpClient given AddAuthioAccountCredential() calls the routes. Paths are relative to /api/v1/admin/realms/{realm}/scim-connections:

EndpointPermissionWhat it does
GET /realm:readThe realm’s connections; with ?organizationId=, the organization’s.
GET /{connectionId}realm:readOne connection: id, name, status (Active or Revoked), baseUrl, organizationId, organizationAlias, identityProviderId, subjectAttribute, clientIds, lastUsedAt, previousTokenValidUntil, revokedAt and provisionedUsers. No read returns the token.
POST /realm:write, secret:writeCreates the connection from name, organizationId, identityProviderId, subjectAttribute (ExternalId or UserName) and clientIds, and answers 201 with the connection, its baseUrl and its token.
PUT /{connectionId}realm:updateChanges name, identityProviderId, subjectAttribute and clientIds.
POST /{connectionId}/rotaterealm:update, secret:writeIssues a new token. previousValueValidForMinutes, from 0 to 1440, keeps the previous one working; 0 or absent refuses it at once.
POST /{connectionId}/revokerealm:deleteRevokes it.
DELETE /{connectionId}realm:deleteDeletes a revoked connection and answers 204.

The token comes back only to a caller holding secret:read; for anyone else it is left out and tokenMasked is true. The refusals are in Error codes.

Node.jsTypeScript
// Create a connection of the realm
const connection = await admin.scimConnection.create({
  realm: 'acme',
  body: { name: 'Contoso Entra ID', subjectAttribute: 'ExternalId', clientIds: ['acme-web'] },
})
// connection.baseUrl and connection.token go to the directory; the token is shown only now.

// Rotate, keeping the previous token for an hour
const rotated = await admin.scimConnection.rotate({
  realm: 'acme',
  connectionId: connection.id!,
  body: { previousValueValidForMinutes: 60 },
})

Microsoft Entra ID

The labels below are those of the Microsoft Entra admin center at the time of writing. Microsoft renames screens often; what matters is where the base URL and the token go.

  1. Open the enterprise application

    In Enterprise applications, open the application people sign in to Authio through, or create one with New application › Create your own application, as an application not found in the gallery.

  2. Turn on automatic provisioning

    In Provisioning, choose the Automatic mode. Under Admin Credentials, paste the base URL in Tenant URL and the token in Secret Token, and choose Test Connection. The test looks up a userName that does not exist, and Authio answers with an empty list.

  3. Check the mappings

    In Mappings, turn off the provisioning of Microsoft Entra ID groups: Authio has no /Groups. In the user mapping, Authio reads only the attributes below, and ignores the others Entra sends:

    Entra attribute (default)SCIM attributeIn Authio
    userPrincipalNameuserNameThe account’s username, compared case-insensitively. It is the matching attribute.
    mailNicknameexternalIdKept for this connection, and the pre-link subject when the attribute chosen is externalId.
    mailemails[type eq "work"].valueThe account’s e-mail.
    Switch([IsSoftDeleted], , "False", "True", "True", "False")activeDeactivates and reactivates the account.
    givenName, surname, displayNamename.givenName, name.familyName, displayNameThe first and last name.
  4. Choose who is provisioned

    In Settings, leave the Scope at syncing only assigned users and groups, and assign the application, in Users and groups, the people who should have an account, directly or through a group.

  5. Turn it on and follow it

    Set Provisioning Status to On and save. Entra provisions in cycles; Provision on demand tries one person right away. Every change shows in the connection’s side panel, in the console, and in the change trail.

Entra over OIDC: link on the verified e-mail

Over OpenID Connect, the sub Microsoft Entra ID puts in the ID token is different for every registered application, and no attribute Entra’s SCIM sends equals it. So pre-linking does not match: the first sign-in through Entra does not find the link SCIM recorded. The console warns about it when you pick an Entra provider over OIDC for the connection.

With Entra over OIDC, leave the connection at No pre-link and link the accounts on the e-mail:

  1. On the Entra provider, choose the Link on verified email mode (LinkOnVerifiedEmail), and turn on Trust this provider’s verified-email claim and Read Microsoft’s verified email claim (xms_edov) (TrustDomainVerifiedEmail). See Account linking.
  2. In the application’s registration in Entra, add email and xms_edov to the ID token, in Token configuration (at the time of writing). Microsoft sends no email_verified; xms_edov says the address’s domain was verified by the tenant.
  3. Keep the SCIM e-mail (mail, in emails[type eq "work"].value) the same as the one in the ID token.

On the first sign-in, Authio signs the person into the account SCIM created with the same e-mail and records the link; from then on, the link holds even if the e-mail changes.

With a SAML provider, the link’s subject is the NameID, or the attribute the provider’s registration puts in its place. When Entra sends the UPN as the NameID, the subject is the same value it sends in userName: choose userName as the subject attribute, and pre-linking matches.

Okta

The labels below are those of the Okta Admin Console, at the time of writing.

  1. Turn on SCIM in the application

    Use the application people sign in to Authio through, or create one in Applications › Create App Integration. On the General tab, under App Settings, choose Edit, select SCIM under Provisioning and save. The Provisioning tab appears.

  2. Set up the connector

    In Provisioning › Integration, choose Edit and fill in:

    • SCIM connector base URL: the connection’s base URL.
    • Unique identifier field for users: userName.
    • Supported provisioning actions: Push New Users and Push Profile Updates. Leave Push Groups unchecked: Authio has no /Groups.
    • Authentication Mode: HTTP Header, with the token in Authorization, as Bearer.

    Choose Test Connector Configuration and save.

  3. Choose what goes to Authio

    In Provisioning › To App, choose Edit, turn on Create Users, Update User Attributes and Deactivate Users, and save.

  4. Assign the people

    In Assignments, assign the people who should have an account, directly or through a group. Okta creates each of them in Authio and keeps their profile.

With Okta over OIDC, the externalId Okta sends is the user’s Okta ID, such as 00u1abc, the same value as the sub in the ID token. That is why externalId is the connection’s default attribute: with the Okta provider pre-linked, the first sign-in through Okta finds the provisioned account.

With a provider chosen on the connection, creating or changing an account over SCIM records the link between the account and that provider’s subject, which is the value of the attribute chosen (externalId or userName). It is the same link federated sign-in records, so the first sign-in through the provider finds the provisioned account, even in the Only linked accounts mode (Deny), instead of creating another or refusing.

  • Another account’s subject. A subject already linked, at that provider, to another account refuses the request with 409 and ScimUniqueness, and nothing is recorded.
  • Up to 128 characters. A longer subject is refused with 400 and ScimInvalidValue.
  • Change. When the attribute’s value changes, the link the connection recorded is replaced by the new one. Links recorded another way, such as an earlier sign-in, stay.
  • No value. With no value in the attribute, no link is recorded.
  • No provider. Nothing is linked: externalId is kept only for the connection, and sign-in follows the provider’s linking mode.
  • Provider changed. The accounts the directory creates after the change are linked to the new provider, and the links that already existed stay.
For a realm only the directory’s people get into, pair pre-linking with the Only linked accounts mode on the provider: the provider proves who the person is, and the directory decides who has an account.

Organization connections

A connection created on an organization’s page provisions its people, through the base URL with the organization’s handle. It differs from a connection of the realm in these points:

  • Membership. Every account it creates, or brings back, becomes a member of the organization.
  • Reach. It reaches the organization’s members and the accounts it created itself; any other account of the realm answers as if it did not exist. For it, active is true only when the account is active and a member.
  • An account that already exists. A userName of a realm account out of reach is adopted only when the e-mail the account already has is at a proven domain of the organization: the account becomes a member and is reached from then on, but the connection never deactivates it. Without a proven domain, the request is refused with 409 and ScimUniqueness.
  • Confirmed e-mail. The e-mail is recorded as confirmed when its domain is a proven domain of the organization, and unconfirmed otherwise. Through a connection of the realm, it is always recorded as confirmed.
  • Provider. The pre-link provider has to be among those offered to the organization; another is refused with ScimConnectionIdentityProviderNotAllowed.
  • Deactivate. Takes the account out of the organization, and deactivates the account itself only when the connection created it and it is a member of no other organization; see Deactivate or delete.

Deactivate or delete

No SCIM call deletes or anonymizes an account. For Authio, leaving the company means being deactivated:

CallConnection of the realmConnection of an organization
active false, by PATCH or PUTDeactivates the account and ends all of its sessions, single sign-on included; the next sign-in, by password or federated, is refused.Takes the account out of the organization. Deactivates the account and ends its sessions only when the connection created it and it is a member of no other organization.
active trueReactivates the account, after checking the plan’s user quota.Gives the membership back and reactivates the account only when the connection created it. Reactivating an account it did not create, deactivated another way, is refused with 400 and ScimMutability.
DELETE /Users/{id}Answers 204 and deactivates as above. The account stays in the realm.Answers 204 and applies the same rule as deactivating.
  • After the DELETE, the account no longer exists for that connection: it leaves the list, and GET, PUT, PATCH and a second DELETE answer 404 with ScimResourceNotFound.
  • A POST /Users with the same userName brings it back, with the same id and the data sent, and the account is active again after the quota check.
  • A change that changes nothing answers with the user, with no effect and no webhook.
Since nothing is deleted, a leaked token deletes no accounts: revoke the connection and reactivate, from the console, the accounts it deactivated. To really delete an account, delete it in the console or through the admin API.

Limits

  • Rate. Each connection has its own limit: up to 600 calls a minute, with a queue of 50. Beyond it, the answer is 429 with Retry-After. One connection’s limit does not touch the others, and an initial load of 10,000 accounts takes about 17 minutes.
  • Pages. GET /Users pages by startIndex, from 1, and count, which is 100 by default and at most; count=0 returns only the total. The order is creation order.
  • Filter. A single eq comparison on userName or emails.value (also emails[type eq "work"].value), case-insensitive in the value, or on externalId, case-sensitive, among those the connection kept only. co, sw, and, or and other attributes are refused with 400 and ScimInvalidFilter; attributes, excludedAttributes, sortBy and sortOrder are ignored.
  • No groups, bulk operations, sorting, ETags or password change.
  • User quota. Creating and reactivating count toward the user quota of the plan of the account that owns the realm. With no room left, the answer is 400 with UserLimitExceeded, and the account is neither created nor reactivated.
  • Sizes. userName, externalId and the e-mail take up to 256 characters, and the pre-link subject up to 128.

Errors

Every refusal under the base URL is written in application/scim+json, in SCIM’s error schema: status, the HTTP code as text; scimType, when RFC 7644 has a type for the refusal; and detail. Authio adds errorCode, its own code, which directories ignore and which matches the refusal to the trail. The body never carries another account’s data.

409 ConflictJSON
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "status": "409",
  "scimType": "uniqueness",
  "detail": "The userName is already taken in the realm.",
  "errorCode": "ScimUniqueness"
}
HTTPscimTypeerrorCodeWhen
400invalidFilterScimInvalidFilterThe filter is not an accepted eq comparison.
400invalidSyntaxScimInvalidSyntaxA PATCH without Operations, with an empty list or with an unknown op. No operation is applied.
400invalidPathScimInvalidPathA PATCH path that does not read as a SCIM path.
400invalidValueScimInvalidValueuserName is missing, or a value is too long or of the wrong type, such as an active that is not a boolean.
400invalidValueValidationFailedThe body could not be read, such as invalid JSON.
400mutabilityScimMutabilityA remove of userName, or a connection of an organization reactivating an account it did not create.
400—UserLimitExceededThe plan’s user quota is used up.
401—UnauthorizedThe token is missing, was revoked, is the previous one of a rotation whose window ended, or belongs to another connection, realm or organization. The answer carries WWW-Authenticate: Bearer realm="authio" and never says which reason it was.
403—ScimProvisioningNotIncludedThe plan of the account that owns the realm does not include SCIM provisioning.
403—IntegrationLicenseSuspendedThe subscription is cancelled, or past due beyond the grace period.
404—ScimResourceNotFoundThe account does not exist, is out of the connection’s reach or was deprovisioned by it; or the resource does not exist, such as /Groups.
409uniquenessScimUniquenessThe userName, or the e-mail in a realm that requires unique e-mails, already belongs to another account; the externalId already belongs to another account of this connection; or the subject is already linked to another account at the provider.
415—UnsupportedMediaTypeThe body is neither application/scim+json nor application/json.
429—TooManyRequestsThe connection went over its rate limit; wait for Retry-After.

The codes the connections’ admin API answers are in Error codes.