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:
| Connection | Base 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:
| Endpoint | What it does |
|---|---|
GET /Users | Lists the accounts the connection reaches, in pages of up to 100, with an optional filter; see Limits. |
POST /Users | Creates 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, /Schemas | Discovery: 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,/Bulkand/Meanswer404. Turn off group provisioning in the directory. - The attributes read are
userName(required),externalId,name.givenName,name.familyName,displayName,emailsandactive. The name comes fromname, or else fromdisplayName, or else fromuserName; the e-mail is theprimaryitem, or else the one oftypework, 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
activefalse), 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, publishesuser_updated, to the realm’s endpoints; see Webhooks. - Format. Answers are written in
application/scim+json, and requests may come inapplication/scim+jsonorapplication/json.
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
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
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.
Fill in the connection
Field What it takes Name Required, up to 100 characters. The trail shows the name as the author of what the directory changes. Identity provider to pre-link Optional. 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 subject externalId(the default) oruserName: the SCIM attribute that carries the identifier the provider authenticates the person with. See Okta and Entra over OIDC.Clients Optional. 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. 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 withoutsecret:readcreates the connection but does not see the token.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
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:
| Action | What it does | Permission |
|---|---|---|
| New SCIM connection | Creates the connection and shows the token once. | realm:write and secret:write |
| Edit | Changes 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 token | Issues 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 |
| Revoke | The 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 |
| Delete | Only 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:
| Endpoint | Permission | What it does |
|---|---|---|
GET / | realm:read | The realm’s connections; with ?organizationId=, the organization’s. |
GET /{connectionId} | realm:read | One 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:write | Creates 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:update | Changes name, identityProviderId, subjectAttribute and clientIds. |
POST /{connectionId}/rotate | realm:update, secret:write | Issues a new token. previousValueValidForMinutes, from 0 to 1440, keeps the previous one working; 0 or absent refuses it at once. |
POST /{connectionId}/revoke | realm:delete | Revokes it. |
DELETE /{connectionId} | realm:delete | Deletes 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.
// 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.
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.
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
userNamethat does not exist, and Authio answers with an empty list.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 attribute In 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. 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.
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:
- 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. - In the application’s registration in Entra, add
emailandxms_edovto the ID token, in Token configuration (at the time of writing). Microsoft sends noemail_verified;xms_edovsays the address’s domain was verified by the tenant. - Keep the SCIM e-mail (
mail, inemails[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.
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.
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.
Choose what goes to Authio
In Provisioning › To App, choose Edit, turn on Create Users, Update User Attributes and Deactivate Users, and save.
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.
Pre-linking federated sign-in
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
409andScimUniqueness, and nothing is recorded. - Up to 128 characters. A longer subject is refused with
400andScimInvalidValue. - 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:
externalIdis 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.
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,
activeis true only when the account is active and a member. - An account that already exists. A
userNameof 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 with409andScimUniqueness. - 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:
| Call | Connection of the realm | Connection of an organization |
|---|---|---|
active false, by PATCH or PUT | Deactivates 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 true | Reactivates 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, andGET,PUT,PATCHand a secondDELETEanswer404withScimResourceNotFound. - A
POST /Userswith the sameuserNamebrings it back, with the sameidand 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.
Limits
- Rate. Each connection has its own limit: up to 600 calls a minute, with a queue of 50. Beyond it, the answer is
429withRetry-After. One connection’s limit does not touch the others, and an initial load of 10,000 accounts takes about 17 minutes. - Pages.
GET /Userspages bystartIndex, from 1, andcount, which is 100 by default and at most;count=0returns only the total. The order is creation order. - Filter. A single
eqcomparison onuserNameoremails.value(alsoemails[type eq "work"].value), case-insensitive in the value, or onexternalId, case-sensitive, among those the connection kept only.co,sw,and,orand other attributes are refused with400andScimInvalidFilter;attributes,excludedAttributes,sortByandsortOrderare 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
400withUserLimitExceeded, and the account is neither created nor reactivated. - Sizes.
userName,externalIdand 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.
{
"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"
}| HTTP | scimType | errorCode | When |
|---|---|---|---|
| 400 | invalidFilter | ScimInvalidFilter | The filter is not an accepted eq comparison. |
| 400 | invalidSyntax | ScimInvalidSyntax | A PATCH without Operations, with an empty list or with an unknown op. No operation is applied. |
| 400 | invalidPath | ScimInvalidPath | A PATCH path that does not read as a SCIM path. |
| 400 | invalidValue | ScimInvalidValue | userName is missing, or a value is too long or of the wrong type, such as an active that is not a boolean. |
| 400 | invalidValue | ValidationFailed | The body could not be read, such as invalid JSON. |
| 400 | mutability | ScimMutability | A remove of userName, or a connection of an organization reactivating an account it did not create. |
| 400 | — | UserLimitExceeded | The plan’s user quota is used up. |
| 401 | — | Unauthorized | The 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 | — | ScimProvisioningNotIncluded | The plan of the account that owns the realm does not include SCIM provisioning. |
| 403 | — | IntegrationLicenseSuspended | The subscription is cancelled, or past due beyond the grace period. |
| 404 | — | ScimResourceNotFound | The 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. |
| 409 | uniqueness | ScimUniqueness | The 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 | — | UnsupportedMediaType | The body is neither application/scim+json nor application/json. |
| 429 | — | TooManyRequests | The connection went over its rate limit; wait for Retry-After. |
The codes the connections’ admin API answers are in Error codes.