Skip to content

Enable/Disable SSO Mapping Rules



POST /api/v1/saml/mapping/set_disable

Overview

Enable or disable the role mapping switch for a single SSO configuration.

Before You Call and Usage Steps

This is a legacy-address compatibility API; the current source code still actually registers it. The historical "removed on 2026-05-31" comment does not mean requests are currently prohibited. For new integrations, prefer Enable/Disable Mapping Rules. The legacy path uses the same controller/request fields/response, and does not exclude OIDC because of the saml prefix.

This group maps login attributes from a specific SSO provider to current workspace roles, and is different from custom_login_mapping for LDAP/OIDC in the Deployment Plan and from system mappings. Creating a rule does not automatically enable mapping: you need to enable isOpenSAMLMapping for the corresponding SSO configuration (set_disable in this group), and the SSO configuration itself must also be enabled.

Attribute name matching is compared in lowercase; values are not regex/contains matches. String arrays are matched value by value; non-array objects/numbers/null, etc., are first converted to strings via json.dumps; array elements are not uniformly converted to strings, so prefer stable string attributes and string arrays from the identity source. When multiple roles match, their union is taken. After SSO mapping is enabled, when there are no rules or no matches, accounts can be blocked from entering this workspace, and old associations are removed in subsequent logins/switches; this is not simply appending a default role. After writing, workspace and member caches are refreshed asynchronously, which may affect subsequent access by existing SSO sessions; it cannot be promised that it will take effect only on the next login.

isDisable=true disables mapping and returns to the provider's default role logic: if an old role association exists at subsequent login, it is retained; only when there is no old role association is the default role added; existing mapped roles are not uniformly reset to the default value. Before disabling, validate the default role: general/readOnly or a valid custom role in this workspace is allowed; Owner/wsAdmin is not allowed. isDisable=false enables mapping; the current implementation only checks whether the workspace has any active mapping and does not limit it to the target ssoUUID, so even true cannot prove that this provider already has a matching rule. First use list?ssoUUID in this group to verify the rules and target roles, to avoid accounts having no permissions after enabling.

This operation only changes SSOSetting.isOpenSAMLMapping; it does not change SSOSetting.status and does not batch-disable mapping rows. When the SSO configuration itself is disabled, enabling mapping does not also enable login. After submission, workspace/member caches are refreshed asynchronously, and no SSO configuration change email is sent; success does not guarantee that all users are authorized correctly.

Request Headers

Parameter Name Type Required Description
DF-API-KEY string Y Workspace OpenAPI authentication credential.
Example: <DF-API-KEY>
How to obtain or enter: Obtain an OpenAPI Key with the permission for this operation from API Key Management in the target workspace.

Body Request Parameters

Parameter Name Type Required Description
ssoUUID string Y Required. This operation verifies that a non-deleted provider exists in this workspace (including disabled configurations).
Example: sso_example
How to obtain or enter: Obtain the target provider UUID from the SSO configuration list in this workspace.
isDisable boolean Y Required boolean; inversely controls isOpenSAMLMapping=1/0, not the provider's own enable/disable state.
Allows null: False
Example: false
How to obtain or enter: false enables mapping, true disables it.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/saml/mapping/set_disable' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"ssoUUID":"sso_example","isDisable":false}'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content boolean true on success; only indicates that the switch submission and cache task dispatch were successful.
{
  "code": 200,
  "content": true,
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Responses

For authentication, rate limiting, and common request errors, see Common Error Definitions.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed Request field missing, or field value violates declared validation conditions Parameter parsing failed Check parameter location, field name, type, and value.
400 ft.RequestJsonFormatError Invalid request JSON syntax Request JSON format error Fix JSON according to content.reason, line, column.
400 ft.JsonFormatError Body is not an object Partial JSON file format error Submit an object containing ssoUUID/isDisable.
406 ft.NotFoundSAML Target provider is not a non-deleted configuration in this workspace SSO configuration not found Retrieve a valid UUID again from the SSO list.
404 ft.NotFoundSSOMappingEnableFailed When enabling, the workspace has no active mappings Enable failed; no role mapping rules found First create mappings actually available to the target provider, then enable.
400 ft.InvalidSsoRoleCfg When disabling, the default role is Owner or wsAdmin Admin/owner role configuration is not supported First change the SSO default role to an allowed value.
400 ft.InvalidCustomRole When disabling, the default custom role is unavailable/is not an active role visible in the current workspace Invalid custom role Select an available default role from the role list in this workspace.
500 ft.InternalServerError An uncaught exception occurs in the saved JSON shape, the database, or post-submission task dispatch Internal error First read isOpenSAMLMapping of the corresponding SSO configuration, verify whether the mapping switch has been saved, and then handle cache refresh or audit; this is not the SSO configuration status enable/disable. Keep traceId.

Feedback

Is this page helpful?