Auth0Client.Management.Connection.Scim (auth0_client v1.0.0)

Copy Markdown View Source

SCIM configuration for a connection — inbound user provisioning.

An external identity provider pushes users into Auth0 over SCIM 2.0, authenticating with a token issued by create_token/2. For the other direction — Auth0 pulling users and groups out of a directory — see Auth0Client.Management.Connection.DirectoryProvisioning.

Every function except all/1 takes a connection id, not a SCIM-configuration id. A connection has at most one SCIM configuration, so there is nothing else to address it by.

Summary

Functions

Gets every SCIM configuration in the tenant

Creates a SCIM configuration for a connection

Creates a SCIM token for a connection

Gets the default SCIM mapping for a connection

Deletes a connection's SCIM configuration

Gets a connection's SCIM configuration

Gets the SCIM tokens for a connection

Updates a connection's SCIM configuration

Functions

all(params \\ %{})

Gets every SCIM configuration in the tenant

Uses checkpoint pagination: omit from on the first call, then pass the next value from the response.

iex> Auth0Client.Management.Connection.Scim.all()
iex> Auth0Client.Management.Connection.Scim.all(take: 50)

create(connection_id, body \\ %{})

Creates a SCIM configuration for a connection

user_id_attribute names the SCIM field to derive unique user ids from. mapping is a list of %{auth0: _, scim: _} pairs; omit both to accept the defaults, which default_mapping/1 reports.

iex> Auth0Client.Management.Connection.Scim.create("some_conn_id")
iex> Auth0Client.Management.Connection.Scim.create("some_conn_id", %{
...>   user_id_attribute: "externalId",
...>   mapping: [%{auth0: "email", scim: "userName"}]
...> })

create_token(connection_id, body \\ %{})

Creates a SCIM token for a connection

token_lifetime is in seconds and must be greater than 900. The token value is returned once, here — Auth0 will not show it again, so store it when you create it.

iex> Auth0Client.Management.Connection.Scim.create_token("some_conn_id", %{
...>   scopes: ["get:users", "post:users"],
...>   token_lifetime: 86_400
...> })

default_mapping(connection_id)

Gets the default SCIM mapping for a connection

What Auth0 uses when create/2 is called without a mapping — useful as the starting point for a custom one.

iex> Auth0Client.Management.Connection.Scim.default_mapping("some_conn_id")

delete(connection_id)

Deletes a connection's SCIM configuration

iex> Auth0Client.Management.Connection.Scim.delete("some_conn_id")

delete_token(connection_id, token_id)

Deletes a SCIM token

iex> Auth0Client.Management.Connection.Scim.delete_token("some_conn_id", "some_token_id")

get(connection_id)

Gets a connection's SCIM configuration

iex> Auth0Client.Management.Connection.Scim.get("some_conn_id")

tokens(connection_id)

Gets the SCIM tokens for a connection

The token values themselves are returned only by create_token/2.

iex> Auth0Client.Management.Connection.Scim.tokens("some_conn_id")

update(connection_id, body)

Updates a connection's SCIM configuration

A PATCH, but Auth0 requires both user_id_attribute and mapping — send the whole configuration, not the part you are changing.

iex> Auth0Client.Management.Connection.Scim.update("some_conn_id", %{
...>   user_id_attribute: "externalId",
...>   mapping: [%{auth0: "email", scim: "userName"}]
...> })