SSO with Management SDKs
If you're using SSO with your Descope tenants, and you want to develop backend APIs to handle this process, this guide covers what you need to know. These are all of the SDK functions you can use in your backend to manage SSO for your tenants.
If you want to use SSO for your application with multiple IdPs, you must configure SSO for each tenant independently. These settings can be configured either via the Descope Console, our self-service sso provisioning widget, our APIs, or using the SDK as shown below.
Install SDK
Import and initialize Management SDK
Identity Provider(IdP) Details
You can either set the identity provider details using a metadata URL from the IdP or enter them in the console. The values for each field can be obtained from the admin console of the identity provider.
Get SSO Configuration
Descope allows you to delete the SSO config for a specified tenant. Use caution with this SDK call as it will remove the configuration and is irreversible.
Delete SSO Configuration
Descope allows you to delete the SSO config for a specified tenant. Use caution with this SDK call as it will remove the configuration and is irreversible.
SSO Mapping
SSO User Attribute Mapping
In this section of the console, you can setup mapping for user attributes. After you set up the mapping, each user that signs into your application will get these attributes assigned from the IdP.
Note
Descope also allows you to map attributes from your IdP to custom user attributes when configuring your attribute mapping.
Groups Mapping
In this part of SSO configuration, you can map SSO groups from your IdP to roles defined in Descope service. The group-to-role mapping will automatically populate the user's roles at the time of sign-in. The roles are included in the session token after successful authentication. It is important to note, this function overrides any previous mapping (even when empty).
SSO Group Management
The Descope SDKs make the SSO Groups available for being loaded. The below covers the available functions.
Load All Groups
Descopers can load all groups for a given tenant, the below covers examples of this.
Load All Groups for Members
Descopers can load all groups for members based on login IDs and user IDs, the below covers examples of this.
Load All Group Members
Descopers can load all groups members based on tenant ID and group ID, the below covers examples of this.