SCIM

System for Cross-Domain Identity Management (SCIM) is a standardized protocol used by enterprise companies to centrally manage access and identity information for all of the applications they use. Companies can make changes to their employees' information or access within their workforce Identity Provider (IdP) and have those changes automatically propagated to all of their connected applications — enabling instant updates, provisioning, and deprovisioning at scale. For B2B SaaS applications, SCIM support is crucial for ensuring your largest customers can maintain data consistency and access management across diverse platforms.

The Javascript SDK provides methods to create and maintain SCIM connections.

Once a Member has successfully logged in, the SDK can be used to view SCIM connections in the Organization if the Member's Role gives them permission to do so.

To learn more about our RBAC implementation, see our RBAC guide.

Methods

Create SCIM Connection

The Create SCIM Connection method wraps the Create SCIM Connection API endpoint. The organization_id will be automatically inferred from the logged-in Member's session. This method cannot be used to create SCIM connections in other Organizations.

This method is not available for unauthenticated end users. In order to call this method, there must be a valid Member Session containing the necessary Role to complete this action. This method requires the Member to have permission to perform the create action on the stytch.scim Resource.

In addition, Member actions & permissions must be enabled in the SDK Configuration page of the Stytch dashboard. To learn more about our RBAC implementation, see our RBAC guide.


Method parameters


display_namestring

idpstring
import { useStytchB2BClient } from '@stytch/react/b2b';

export const CreateSCIMConnection = () => {
  const stytch = useStytchB2BClient();

  const createSCIMConnection = () => {
    stytch.scim.createConnection({
      display_name: 'Example SCIM connection',
    });
  };

  return <button onClick={createSCIMConnection}>Create an SCIM Connection</button>;
};

RESPONSE

200
{
	"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
	"status_code": 200,
    "connection": {
        "organization_id": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931"
        "connection_id": "scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc"
        "status": "active",
        "display_name": "My SCIM Connection"
        "idp": "okta"
        "base_url": "https://test.stytch.com/v1/b2b/scim/scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc"
        "bearer_token": "9LmcAfUxGGMSNzfROGY762wTD3A6DQsD3hmxbrAJaEjTsdko"
        "bearer_token_expires_at": "2029-03-20T21:28:28Z"
    },
}

Update SCIM Connection

The Update SCIM Connection method wraps the Update SCIM Connection API endpoint. The organization_id will be automatically inferred from the logged-in Member's session. This method cannot be used to update SCIM connections in other Organizations.

This method is not available for unauthenticated end users. In order to call this method, there must be a valid Member Session containing the necessary Role to complete this action. This method requires the Member to have permission to perform the update action on the stytch.scim Resource.

In addition, Member actions & permissions must be enabled in the SDK Configuration page of the Stytch dashboard. To learn more about our RBAC implementation, see our RBAC guide.


Method parameters


connection_id*string

idpstring
import { useStytchB2BClient } from '@stytch/react/b2b';

export const UpdateSCIMConnection = () => {
  const stytch = useStytchB2BClient();

  const updateSCIMConnection = () => {
    stytch.scim.updateConnection({
      connection_id: 'scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc',
      displayName: 'Updated SCIM connection name',
    });
  };

  return <button onClick={updateSCIMConnection}>Update SCIM Connection</button>;
};

RESPONSE

200
{
	"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
	"status_code": 200,
    "connection": {
        "organization_id": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931"
        "connection_id": "scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc"
        "status": "active",
        "display_name": "My SCIM Connection"
        "idp": "okta"
        "base_url": "https://test.stytch.com/v1/b2b/scim/scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc"
        "bearer_token_last_four": "sdko"
        "bearer_token_expires_at": "2029-03-20T21:28:28Z"
    },
}

Delete SCIM Connection

The Delete SCIM Connection method wraps the Delete SCIM Connection API endpoint. The organization_id will be automatically inferred from the logged-in Member's session. This method cannot be used to delete SCIM connections in other Organizations.

This method is not available for unauthenticated end users. In order to call this method, there must be a valid Member Session containing the necessary Role to complete this action. This method requires the Member to have permission to perform the delete action on the stytch.scim Resource.

In addition, Member actions & permissions must be enabled in the SDK Configuration page of the Stytch dashboard. To learn more about our RBAC implementation, see our RBAC guide.


Method parameters


connection_id*string
import { useStytchB2BClient } from '@stytch/react/b2b';

export const DeleteSCIMConnection = () => {
  const stytch = useStytchB2BClient();

  const deleteSCIMConnection = () => {
    stytch.scim.deleteConnection('scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc');
  };

  return <button onClick={deleteSCIMConnection}>Delete SCIM Connection</button>;
};

RESPONSE

200
{
	"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
	"status_code": 200,
    "connection_id": "scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc",
}

Get SCIM Connections

The Get SCIM Connections method wraps the Get SCIM Connections API endpoint. The organization_id will be automatically inferred from the logged-in Member's session. This method cannot be used to get SCIM connections from other Organizations.

This method is not available for unauthenticated end users. In order to call this method, there must be a valid Member Session containing the necessary Role to complete this action. This method requires the Member to have permission to perform the get action on the stytch.scim Resource.

In addition, Member actions & permissions must be enabled in the SDK Configuration page of the Stytch dashboard. To learn more about our RBAC implementation, see our RBAC guide.

import { useStytchB2BClient } from '@stytch/react/b2b';

export const GetSCIMConnections = () => {
  const stytch = useStytchB2BClient();

  const getSCIMConnections = () => {
    stytch.scim.getConnections();
  };

  return <button onClick={getSCIMConnections}>Get SCIM Connections</button>;
};

RESPONSE

200
{
	"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
	"status_code": 200,
    "connections": [{
        "organization_id": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931"
        "connection_id": "scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc"
        "status": "active",
        "display_name": "My SCIM Connection"
        "idp": "okta"
        "base_url": "https://test.stytch.com/v1/b2b/scim/scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc"
        "bearer_token_last_four": "sdko"
        "bearer_token_expires_at": "2029-03-20T21:28:28Z"
    }],
}

SCIM Rotate Token Start

The SCIM Rotate Token Start method wraps the SCIM Rotate Token Start API endpoint. The organization_id will be automatically inferred from the logged-in Member's session. This method cannot be used to start token rotations for SCIM connections in other Organizations.

This method is not available for unauthenticated end users. In order to call this method, there must be a valid Member Session containing the necessary Role to complete this action. This method requires the Member to have permission to perform the update action on the stytch.scim Resource.

In addition, Member actions & permissions must be enabled in the SDK Configuration page of the Stytch dashboard. To learn more about our RBAC implementation, see our RBAC guide.


Method parameters


connection_id*string
import { useStytchB2BClient } from '@stytch/react/b2b';

export const RotateSCIMTokenStart = () => {
  const stytch = useStytchB2BClient();

  const rotateSCIMTokenStart = () => {
    stytch.scim.startRotateToken({
      connection_id: 'scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc',
    });
  };

  return <button onClick={rotateSCIMTokenStart}>Start SCIM Token Rotation</button>;
};

RESPONSE

200
{
  "connection": {
      "organization_id": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931"
      "connection_id": "scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc"
      "status": "active",
      "display_name": "My SCIM Connection"
      "idp": "okta"
      "base_url": "https://test.stytch.com/v1/b2b/scim/scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc"
      "bearer_token_last_four": "sdko"
      "bearer_token_expires_at": "2029-03-20T21:28:28Z
      "next_bearer_token": "8TqbGcJyFFLSNveQPGZ861xSE2B7CPtC2gnyasAIbDiUrcjn"
      "next_bearer_token_expires_at": "2030-03-20T21:28:28Z"
  },
}

SCIM Rotate Token Complete

The SCIM Rotate Token Complete method wraps the SCIM Rotate Token Complete API endpoint. The organization_id will be automatically inferred from the logged-in Member's session. This method cannot be used to complete token rotations for SCIM connections in other Organizations.

This method is not available for unauthenticated end users. In order to call this method, there must be a valid Member Session containing the necessary Role to complete this action. This method requires the Member to have permission to perform the update action on the stytch.scim Resource.

In addition, Member actions & permissions must be enabled in the SDK Configuration page of the Stytch dashboard. To learn more about our RBAC implementation, see our RBAC guide.


Method parameters


connection_id*string
import { useStytchB2BClient } from '@stytch/react/b2b';

export const RotateSCIMTokenComplete = () => {
  const stytch = useStytchB2BClient();

  const rotateSCIMTokenComplete = () => {
    stytch.scim.completeRotateToken({
      connection_id: 'scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc',
    });
  };

  return <button onClick={rotateSCIMTokenComplete}>Complete SCIM Token Rotation</button>;
};

RESPONSE

200
{
  "connection": {
      "organization_id": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931"
      "connection_id": "scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc"
      "status": "active",
      "display_name": "My SCIM Connection"
      "idp": "okta"
      "base_url": "https://test.stytch.com/v1/b2b/scim/scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc"
      "bearer_token_expires_at": "2029-03-20T21:28:28Z"
      "bearer_token_last_four": "sdko"
  },
}

SCIM Rotate Token Cancel

The SCIM Rotate Token Cancel method wraps the SCIM Rotate Token Cancel API endpoint. The organization_id will be automatically inferred from the logged-in Member's session. This method cannot be used to cancel token rotations for SCIM connections in other Organizations.

This method is not available for unauthenticated end users. In order to call this method, there must be a valid Member Session containing the necessary Role to complete this action. This method requires the Member to have permission to perform the update action on the stytch.scim Resource.

In addition, Member actions & permissions must be enabled in the SDK Configuration page of the Stytch dashboard. To learn more about our RBAC implementation, see our RBAC guide.


Method parameters


connection_id*string
import { useStytchB2BClient } from '@stytch/react/b2b';

export const RotateSCIMTokenCancel = () => {
  const stytch = useStytchB2BClient();

  const rotateSCIMTokenCancel = () => {
    stytch.scim.cancelRotateToken({
      connection_id: 'scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc',
    });
  };

  return <button onClick={rotateSCIMTokenCancel}>Cancel SCIM Token Rotation</button>;
};

RESPONSE

200
{
  "connection": {
      "organization_id": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931"
      "connection_id": "scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc"
      "status": "active",
      "display_name": "My SCIM Connection"
      "idp": "okta"
      "base_url": "https://test.stytch.com/v1/b2b/scim/scim-connection-test-cdd5415a-c470-42be-8369-5c90cf7762dc"
      "bearer_token_expires_at": "2029-03-20T21:28:28Z"
      "bearer_token_last_four": "sdko"
  },
}