Skip to content

Modify SSO Mapping Rule



POST /api/v1/saml/mapping/field/{fdmp_uuid}/modify

Overview

Update SSO attribute mappings and provider binding as a whole.

Before Calling and Usage Steps

This is a legacy-address compatibility endpoint and is still actually registered in the current source code; the historical “removed on 2026-05-31” comment does not mean requests are currently prohibited. For new integrations, prefer Modify Mapping Rule. 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 of a specific SSO provider to roles in the current Workspace, which differs from custom_login_mapping and system mappings for LDAP/OIDC in the Deployment Plan. Creating a rule does not automatically enable mapping: you need to enable isOpenSAMLMapping for the corresponding SSO configuration (this group's set_disable), and the SSO configuration itself must also be enabled.

Attribute name matching compares 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 with json.dumps, while 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 used. After SSO mapping is enabled, the absence of rules or matches can prohibit an account from entering this Workspace, and old associations are deleted during 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 from existing SSO sessions; it cannot be promised that the effect will only apply at the next login.

You must explicitly submit ssoUUID and the three mapping fields; the update overwrites as a whole and does not merge by field. Omitting ssoUUID currently writes None into a non-null column, causing a 500, so the optional declaration cannot be understood as retaining the original value. Changing ssoUUID does not prove the new provider is valid; first query the SSO list for this Workspace. Input roles are filtered; after saving, verify targetValues/roleInfos against ssoInfo. After submission, a cache refresh task is dispatched; if dispatch fails, a 500 may occur but the rule has already been saved; do not blindly create it repeatedly. This group does not send SSO configuration change emails and does not apply the needNotify parameter of shared SSO create/modify to this page.

Route Parameters

Parameter Name Type Required Description
fdmp_uuid string Y This is not the provider UUID or a Deployment Plan custom lgmp_.
Example: fdmp_example
How to obtain or fill in: Take this Workspace's fdmp_ from content.data[].uuid in the mapping list.

Request Headers

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

Body Request Parameters

Parameter Name Type Required Description
targetValues[*] string String, not a display name; do not submit nested objects; the current element shape is not subject to uniform strong typing validation.
Example: general
How to obtain or fill in: A single role UUID/system identifier visible in this Workspace.
ssoUUID string Required for creation; although modification declares it optional, the implementation overwrites the old ssoUUID with the omitted value None, and a normal submission may cause a database 500, so you must explicitly fill in the current/new target. Current create/modify operations do not enforce validation that the SSO exists or belongs to the Workspace; a successful save does not prove the target is valid; do not submit UUIDs from other Workspaces or fake UUIDs.
Allow null: False
Maximum length: 48
Example: sso_example
How to obtain or fill in: Get the current Workspace provider uuid from the SSO Configuration List; choose SAML or OIDC according to the actual configuration.
sourceField string Y Required; a non-empty value is recommended. Field names are case-insensitive during matching, but same-name checks are still determined by database equality semantics; dot paths are not supported. Creation has no uniform maximum-length declaration, modification is ≤256, the storage column is 256, and it is recommended to keep both ≤256.
Allow null: False
Maximum length: 256
Example: groups
How to obtain or fill in: Have the identity provider administrator provide the actual top-level attributes field name.
sourceValue string Y Required; a non-empty value is recommended. This is not a wildcard/regex; creation does not declare a length, modification is ≤256 and the storage column is 256, and it is recommended to keep both ≤256.
Allow null: False
Maximum length: 256
Example: engineering
How to obtain or fill in: Take the actual string of the attribute or a single element in a string array; do not enter the full array text.
targetValues array Y Required array; a non-empty value is recommended; some unknown/cross-Workspace roles are filtered out, roles with status 0/2 are retained; [] or no visible records at all reports NotFoundRole. Saving status 2 does not guarantee it is currently available, and roleInfos in the list only shows 0. When all targets are soft-deleted but the records still exist, they may be filtered into an empty set, which is not treated as a valid mapping.
Example: ["general"]
How to obtain or fill in: Get visible role identifiers from the current Workspace's Role List, such as general/readOnly/custom role_.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/saml/mapping/field/fdmp_example/modify' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"ssoUUID":"sso_example","sourceField":"groups","sourceValue":"engineering","targetValues":["general"]}'

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; does not return the mapping entity or login result.
{
  "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 A request field is missing, or a field value violates the declared validation conditions Parameter parsing failed Verify the parameter location, field name, type, and value.
400 ft.RequestJsonFormatError Invalid request JSON syntax Request JSON format error Correct the JSON according to content.reason, line, and column.
400 ft.JsonFormatError The top level of the Body is not an object Partial JSON file format error Submit a complete ssoUUID/sourceField/sourceValue/targetValues object.
404 ft.SamlMappingFieldAlreadyExists A non-deleted mapping with the same ssoUUID+sourceField+sourceValue already exists in this Workspace (modification excludes itself) A mapping with the same field name and field value already exists in the Workspace Use a new combination or update the existing UUID; note that the HTTP status is 404.
404 ft.NotFoundRole The input roles or old mapping target set contains no role records visible in this Workspace, including []; modification/deletion audits may also trigger this The specified role was not found or has been deleted Check the current input/old targets against the role list; do not treat an empty set as a successful clear; for historical bad rules, have an administrator fix them before proceeding.
500 ft.InternalServerError An uncaught exception occurs in the JSON shape being saved, the database, or post-submission task dispatch Internal error The database may have committed while cache task dispatch failed; first read back the rule/SSO switch from the list before proceeding, and retain traceId.
404 ft.SamlMappingNoExists No non-deleted mapping record for fdmp_uuid exists in this Workspace The specified Saml Mapping was not found Retrieve the fdmp_ UUID again from the mapping list in this Workspace; it is not sso_ or lgmp_.

Feedback

Is this page helpful?