Skip to content

Modify Mapping Rule



POST /api/v1/sso_mapping/field/{fdmp_uuid}/modify

Overview

Update the SSO attribute mapping and provider binding as a whole.

Before Calling and Usage Steps

This group maps the 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 (set_disable in this group), and the SSO configuration itself must also be enabled.

Attribute name matching compares in lowercase, and values are not regex/contains matches. String arrays are matched value by value; non-array objects/numbers/null, etc. are first converted to strings using 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, no rule/no match can block an account from entering this workspace and remove old associations during subsequent logins/switches; it does not simply append 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 to take effect only on the next login.

You must explicitly submit ssoUUID and the three mapping fields; the update overwrites the entire mapping and does not merge by field. Omitting ssoUUID currently writes None to a non-null column and causes a 500; do not interpret the optional declaration as preserving the existing value. Changing ssoUUID does not prove that the new provider is valid; first check the SSO list for this workspace. Input roles are filtered; after saving, verify targetValues/roleInfos and 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 again. This group does not send SSO configuration change emails, and the needNotify parameter of the shared SSO create/modify does not apply to this page.

Route Parameters

Parameter Name Type Required Description
fdmp_uuid string Y Not the provider UUID or the custom lgmp_ in the Deployment Plan.
Example: fdmp_example
How to obtain or fill in: Get the fdmp_ for this workspace 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 the required permissions 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 type validation.
Example: general
How to obtain or fill in: A role UUID/system identifier visible in this workspace.
ssoUUID string Declared as 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. Creation and modification currently 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 a UUID from another workspace or a fake UUID.
Allow null: False
Maximum length: 48
Example: sso_example
How to obtain or fill in: Obtain the provider uuid for the current workspace from the SSO configuration list; choose SAML or OIDC based on the actual configuration.
sourceField string Y Required; non-empty 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 unified maximum length declaration, modification is ≤256, and the storage column is 256; it is recommended to keep both ≤256.
Allow null: False
Maximum length: 256
Example: groups
How to obtain or fill in: Ask the identity provider administrator for the actual top-level attributes field name.
sourceValue string Y Required; non-empty is recommended. It is not a wildcard/regex; creation does not declare a length, modification is ≤256, and the storage column is 256; it is recommended to keep both ≤256.
Allow null: False
Maximum length: 256
Example: engineering
How to obtain or fill in: Use the actual attribute string or a single element from a string array; do not enter the full array text.
targetValues array Y Required array; non-empty is recommended. Some unknown/cross-workspace roles are filtered out, while status 0/2 are retained; [] or no visible records at all reports NotFoundRole. Saving status 2 does not guarantee current availability, and the roleInfos list only shows 0. If all targets are soft-deleted but records still exist, they may be filtered into an empty set and are not treated as a valid mapping.
Example: ["general"]
How to obtain or fill in: Obtain a visible role identifier from the role list in the current workspace, such as general/readOnly/custom role_.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/sso_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 Request field is missing, or the field value violates the declared validation conditions Parameter parsing failed Check 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 the old mapping target set contain no visible role records in this workspace, including []; modification/deletion audits may also trigger this The specified role was not found or has been deleted Verify the current input/old targets from the role list; do not treat an empty set as successful clearing; for historical bad rules, ask an administrator to repair them before proceeding.
500 ft.InternalServerError An uncaught exception occurs in the saved JSON shape, 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 fdmp_uuid has no non-deleted mapping record in this workspace The specified Saml Mapping was not found Retrieve the fdmp_ UUID again from the mapping list for this workspace; it is not sso_ or lgmp_.

Feedback

Is this page helpful?