Skip to content

Create SSO Configuration



POST /api/v1/sso/create

Overview

Create a SAML or OIDC identity provider for a workspace.

Prerequisites and Usage Steps

Before creating, register the client/application for Guance in the IdP, and confirm the production endpoints and the default role of this workspace. For SAML, submit the real, complete metadata XML; for OIDC, submit the Base64-encoded clientSecret and the complete configuration. By default, status=0 and isOpenSAMLMapping=0 are set on creation. After success, the provider may immediately be used for login discovery, so do not pass enable/disable fields in this Body. To control access by role mapping, configure the mapping separately and then enable it.

This creation does not perform full SSO login acceptance. When wellKnowURL is provided, a real GET service discovery is performed synchronously (TLS verification is enabled by default during the save phase); if that address is absent, you can use the explicit auth/token/userinfo three endpoints. Other authentication, code-for-token, and JWT/UserInfo protocol details are only consumed at login time. Currently, userinfo with a non-get method still sends GET + Body, so POST endpoints are not guaranteed to work. By default, OIDC scope is only openid and the user source is origin; if email/profile is required, specify it explicitly according to IdP permissions and test it in practice. Beyond the declared field types, many dynamic fields are not strictly validated at save time, so a 200 does not mean the entire flow can log in.

After the database commit, workspace/member cache refresh tasks are dispatched, which may cause existing SSO access to be re-authenticated; the configuration response does not mean all caches have been refreshed. needNotify defaults to true and sends a configuration reminder to the workspace Owner/administrators; false only suppresses the email, while auditing/caching still occur, and email delivery failures are recorded but do not roll back the configuration. The create response includes the emails allowlist and a snapshot of the data at creation time; call get again to verify the actually saved configuration; the secret in the write response is stored ciphertext, and only the details get returns the asterisk mask that can be used for retention.

Request Headers

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

Body Request Parameters

Parameter Type Required Description
emailDomains[*] string A non-empty string is recommended; the public array does not strictly validate the email format for each item, malformed objects/nested arrays may cause a 500, and length is constrained by the 256 storage limit.
Example: example.com
How to obtain or fill in: Take a single real email/domain identifier and keep it consistent with the email returned by the identity source.
config.modeType string Optional easy/expert, default easy; this field mainly records the editing mode and does not automatically validate arbitrary expert configurations as executable.
Example: expert
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.wellKnowURL string Optional HTTP(S) discovery address; when provided, a real GET is performed and the JSON is parsed during the save phase (not an offline validation); request failures/SSL/HTTP errors return the errors on this page. If omitted, the auth/token/userinfo three endpoints must be specified explicitly; you cannot just set modeType=expert.
Example: https://idp.example.com/.well-known/openid-configuration
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.sslVerify boolean TLS verification switch for discovery requests. Defaults to true during the save phase; at runtime the SDK defaults to true for HTTPS and false for HTTP; it is not a global switch for each endpoint's verify.
Example: true
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.clientId string Required for OIDC; must be a non-empty string without leading or trailing whitespace; obtained from the IdP client registration, not a Studio API Key.
Example: client_example
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.clientSecret string The OIDC client secret is UTF-8 plaintext encoded in Base64 first (the example is the encoding of placeholder plaintext, not an actual secret). On creation, it must be non-empty after decoding and must not be all asterisks; Base64 is not encrypted transport, so HTTPS must be used. When modifying a non-empty config, you must retain the old secret by taking the Base64 asterisk mask returned by get; omitting it or passing an empty string will still be rejected by subsequent configuration validation and is not an instruction to retain it. Do not send back the stored ciphertext from the create/modify response.
Example: U0VDUkVULVBMQUNFSE9MREVS
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.grantType string Optional authorization_code/code; if omitted, the runtime default is authorization_code. It is not client_credentials or password authorization.
Example: authorization_code
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.scope array Optional string array; at runtime the SDK defaults to only [openid], not openid/profile/email as in older documentation. Ensure the IdP actually provides the claims required by the account, such as email; an empty array produces an empty scope, so clients should configure it explicitly and sensibly.
Example: ["openid", "profile", "email"]
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.scope[*] string A single scope allowed by the IdP; it is not a permission point of this workspace.
Example: email
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.authSet json Authorization redirect parameter object; may be omitted so that the address is filled in from the discovery document.
Example: {}
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getTokenSet json Code-for-token request object; endpoints may be omitted and taken from the discovery document.
Example: {}
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.verifyTokenSet json JWK object for id_token signature verification; it does not initiate token authentication immediately in order to save the configuration.
Example: {}
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getUserInfoSet json User information source/request object; defaults to origin, not id_token as in older documentation.
Example: {}
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.claimMapping json Mapping from account fields to the actual attribute names in the IdP; it is not a role mapping rule. OIDC saving does not strictly validate each item, so the callback must be tested in practice; a non-empty SAML mapping must provide non-empty username/email at the same time, and mobile is an optional string. An empty object is compatible with the old defaults.
Example: {"username": "preferred_username", "email": "email", "mobile": "phone_number"}
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.authSet.url string Optional explicit HTTP(S) URL; if not provided, authorization_endpoint is taken from the discovery document; a value overrides the runtime endpoint. Without a discovery document, auth/token/userinfo are all required, and the signature verification source must separately ensure JWK availability.
Example: https://idp.example.com/authorize
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.authSet.paramMapping json Optional mapping for non-standard request parameters. When non-empty, it replaces the corresponding default parameter set, so required items must be fully retained; keys are IdP parameter names, and values can be $ variables allowed on this page or fixed strings. Do not map clientSecret into the authorization redirect URL.
Example: {}
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.authSet.paramMapping.Target parameter name string Dynamic IdP parameter value; the allowed variable range varies by stage, see the table below; unknown strings are kept as constants and are not automatically resolved from arbitrary internal context.
Example: $client_id
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getTokenSet.url string Optional explicit HTTP(S) URL; if not provided, token_endpoint is taken from the discovery document; a value overrides the runtime endpoint. Without a discovery document, auth/token/userinfo are all required, and the signature verification source must separately ensure JWK availability.
Example: https://idp.example.com/token
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getTokenSet.verify boolean Optional; for this endpoint, HTTPS defaults to true and HTTP to false; configured separately and not uniformly replaced by sslVerify.
Example: true
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getTokenSet.paramMapping json Optional mapping for non-standard request parameters. When non-empty, it replaces the corresponding default parameter set, so required items must be fully retained; keys are IdP parameter names, and values can be $ variables allowed on this page or fixed strings. Do not map clientSecret into the authorization redirect URL.
Example: {}
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getTokenSet.paramMapping.Target parameter name string Dynamic IdP parameter value; the allowed variable range varies by stage, see the table below; unknown strings are kept as constants and are not automatically resolved from arbitrary internal context.
Example: $client_id
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.verifyTokenSet.url string Optional explicit HTTP(S) URL; if not provided, jwks_uri is taken from the discovery document; a value overrides the runtime endpoint. Without a discovery document, auth/token/userinfo are all required, and the signature verification source must separately ensure JWK availability.
Example: https://idp.example.com/jwks
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.verifyTokenSet.verify boolean Optional; for this endpoint, HTTPS defaults to true and HTTP to false; configured separately and not uniformly replaced by sslVerify.
Example: true
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getUserInfoSet.url string Optional explicit HTTP(S) URL; if not provided, userinfo_endpoint is taken from the discovery document; a value overrides the runtime endpoint. Without a discovery document, auth/token/userinfo are all required, and the signature verification source must separately ensure JWK availability.
Example: https://idp.example.com/userinfo
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getUserInfoSet.verify boolean Optional; for this endpoint, HTTPS defaults to true and HTTP to false; configured separately and not uniformly replaced by sslVerify.
Example: true
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getUserInfoSet.paramMapping json Optional mapping for non-standard request parameters. When non-empty, it replaces the corresponding default parameter set, so required items must be fully retained; keys are IdP parameter names, and values can be $ variables allowed on this page or fixed strings. Do not map clientSecret into the authorization redirect URL.
Example: {}
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getUserInfoSet.paramMapping.Target parameter name string Dynamic IdP parameter value; the allowed variable range varies by stage, see the table below; unknown strings are kept as constants and are not automatically resolved from arbitrary internal context.
Example: $client_id
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getTokenSet.method string Optional get/post, default post; only these two are supported at runtime; saving does not enforce this enumeration, and other values will cause errors on subsequent logins.
Example: post
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getTokenSet.authMethod string Optional basic/client_secret_basic (Basic header by default), client_secret_post (form contains ID and secret by default), none (only client_id by default, without automatically including the secret). When a custom paramMapping exists, parameters are generated from the complete mapping, and the Basic header still follows the selected authentication method.
Example: client_secret_basic
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getUserInfoSet.method string Default get. The current SDK's non-get branch still sends GET but places parameters in the Body, which is not a true POST; for an IdP that requires POST, do not assume support based solely on a successful save; use a verified GET endpoint instead.
Example: get
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getUserInfoSet.authMethod string Default bearer header; client_secret_basic uses the Basic header; none places access_token in parameters by default. The basic alias or any other value is not treated as equally effective.
Example: bearer
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getUserInfoSet.source string origin calls userinfo (default); id_token verifies and reads id_token; merge uses id_token first and then userinfo to override keys with the same name. Saving does not enforce the enumeration, and other values may ultimately yield no user information.
Example: origin
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.getUserInfoSet.responseInfoPath string Optional dot path to the user object in the response, extracted only for origin results; an empty string takes the entire response, which differs from the attribute name in claimMapping.
Example: data.user
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.verifyTokenSet.keys array Optional array of public JWKs from the IdP; if non-empty, it is used directly for signature verification; otherwise a GET to verifyTokenSet.url is performed at runtime to obtain keys. These are not private keys; do not treat the example placeholder material as real signature verification configuration.
Example: []
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.verifyTokenSet.keys[*] json A single public JWK; retain the complete structure with the kty/alg/kid and public key parameters published by the IdP.
Example: {}
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.verifyTokenSet.keys[*].kty string Public key type, such as RSA/EC; subject to the IdP JWK.
Example: RSA
How to obtain or fill in: Obtain the complete public value from the IdP's production JWKS; do not construct it by hand.
config.verifyTokenSet.keys[*].kid string Identifier used to select the public key.
Example: KEY-ID
How to obtain or fill in: Obtain the complete public value from the IdP's production JWKS; do not construct it by hand.
config.verifyTokenSet.keys[*].use string Key usage.
Example: sig
How to obtain or fill in: Obtain the complete public value from the IdP's production JWKS; do not construct it by hand.
config.verifyTokenSet.keys[*].alg string Signature verification algorithm identifier.
Example: RS256
How to obtain or fill in: Obtain the complete public value from the IdP's production JWKS; do not construct it by hand.
config.verifyTokenSet.keys[*].n string RSA modulus in Base64url.
Example: PUBLIC-MODULUS
How to obtain or fill in: Obtain the complete public value from the IdP's production JWKS; do not construct it by hand.
config.verifyTokenSet.keys[*].e string RSA public exponent in Base64url.
Example: AQAB
How to obtain or fill in: Obtain the complete public value from the IdP's production JWKS; do not construct it by hand.
config.verifyTokenSet.keys[*].crv string EC curve, only for the corresponding types.
Example: P-256
How to obtain or fill in: Obtain the complete public value from the IdP's production JWKS; do not construct it by hand.
config.verifyTokenSet.keys[*].x string EC public x coordinate.
Example: PUBLIC-X
How to obtain or fill in: Obtain the complete public value from the IdP's production JWKS; do not construct it by hand.
config.verifyTokenSet.keys[*].y string EC public y coordinate.
Example: PUBLIC-Y
How to obtain or fill in: Obtain the complete public value from the IdP's production JWKS; do not construct it by hand.
config.verifyTokenSet.keys[*].x5c array Array of public certificate chain in Base64 DER; optional.
Example: ["PUBLIC-CERTIFICATE"]
How to obtain or fill in: Obtain the complete public value from the IdP's production JWKS; do not construct it by hand.
config.verifyTokenSet.keys[*].x5c[*] string A single public certificate, without a private key.
Example: PUBLIC-CERTIFICATE
How to obtain or fill in: Obtain the complete public value from the IdP's production JWKS; do not construct it by hand.
config.verifyTokenSet.keys[*].Other public fields JSON IdP JWK extensions are retained according to library protocol; do not add private key material such as d/p/q.
Example: VALUE
How to obtain or fill in: Obtain the complete public value from the IdP's production JWKS; do not construct it by hand.
config.claimMapping.username string OIDC defaults to preferred_username; SAML defaults to username. When an explicit non-empty claimMapping is provided for SAML, this must be a non-empty string.
Example: preferred_username
How to obtain or fill in: The IdP administrator provides the actual attribute name; field mapping does not mean writing a fixed mobile number/email as the value.
config.claimMapping.email string Defaults to email; an actual login must obtain a valid email. Required when an explicit non-empty claimMapping is provided for SAML; OIDC saving does not verify the value/source, but the callback still requires an email.
Example: email
How to obtain or fill in: The IdP administrator provides the actual attribute name; field mapping does not mean writing a fixed mobile number/email as the value.
config.claimMapping.name string Optional display name attribute for OIDC, default name; SAML currently always reads name, and this mapping key does not change its display name extraction.
Example: name
How to obtain or fill in: The IdP administrator provides the actual attribute name; field mapping does not mean writing a fixed mobile number/email as the value.
config.claimMapping.mobile string OIDC defaults to phone_number; SAML defaults to mobile; an explicit empty string means no extraction. If there is no number it is not added; an existing mobile number and area code are retained, and it is only added when the original account has no number and the IdP number is valid.
Example: phone_number
How to obtain or fill in: The IdP administrator provides the actual attribute name; field mapping does not mean writing a fixed mobile number/email as the value.
config.authSet.verify boolean Retained for compatibility and can be saved, but the current OIDC SDK does not consume this key and it cannot control requests/TLS; use the corresponding field that is actually read on this page.
Example: true
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.verifyTokenSet.method string Retained for compatibility and can be saved, but the current OIDC SDK does not consume this key and it cannot control requests/TLS; use the corresponding field that is actually read on this page.
Example: get
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
config.verifyTokenSet.authMethod string Retained for compatibility and can be saved, but the current OIDC SDK does not consume this key and it cannot control requests/TLS; use the corresponding field that is actually read on this page.
Example: get
How to obtain or fill in: Obtain it from the production OIDC configuration assigned by the identity provider to the current client and the actual protocol documentation.
type string Y Required on creation; on modification the type follows the original configuration, and type is not accepted to change the protocol.
Allowed null: False
Allowed values: ['saml', 'oidc']
Example: oidc
How to obtain or fill in: Choose saml or oidc according to the identity provider protocol.
idpData string Required for SAML creation; must contain entityID, the SSO service address, and the key description; on modification, omitting it or passing an empty string keeps the old XML. When SAML submits a non-empty config, a valid XML must be provided at the same time. Do not pass it for OIDC; for OIDC, if only idpData changes and there is no config, the identity digest may be written as None and cause a 500.
Allowed null: False
Example: <IdP_METADATA_XML>
How to obtain or fill in: Download the complete valid IdP metadata XML from the SAML identity provider administrator and submit it as a literal string.
config json Dynamic complete configuration object; required for OIDC creation. On modification, omitting it or passing {} keeps the old config; a non-empty object replaces it as a whole, not a recursive merge, and OIDC must provide clientId/clientSecret/valid URLs, etc. SAML cannot submit only a non-empty config while omitting idpData. Internal field types are not all strictly validated, and a successful save does not prove the callback works.
Allowed null: False
Example: {}
How to obtain or fill in: For OIDC, construct it from the provider client/discovery document and protocol parameters; for SAML it is used only for the optional claimMapping.
emailDomains array Y Required array; may be [], and the server deduplicates with a set. It is not a URL, regular expression, or wildcard with @; initial entry discovery matches by exact full email or domain, and existing SSO identities follow separate namespace/workspace relationship rules; it cannot replace general access control. On modification it replaces the entire allowlist; [] clears it.
Example: ["example.com"]
How to obtain or fill in: Take the full email or email domain that is allowed to discover this provider, such as user@guance.com or example.com.
idpName string Y Required, ≤64 characters, declared regex [a-zA-Z_一-龥-]*; it is recommended to use only letters/Chinese characters/underscores/hyphens, without digits/spaces; the current regex is not fully anchored, which does not mean arbitrary trailing characters are reliably rejected. Provider names that are not deleted within the same workspace must be unique; on modification, only a non-empty value overrides the old name.
Maximum length: 64
$matchRegExp: [a-zA-Z_一-龥-]*
Example: ExampleIdP
How to obtain or fill in: A name that distinguishes identity providers in the current workspace for business purposes.
role string Y Required; general/readOnly or an active custom role visible in this workspace; owner/wsAdmin are prohibited. When mapping is off, it is used to create the role relationship and does not guarantee overriding all old roles of existing members; when role mapping is on, access is determined by mapping matches.
Allowed null: False
Allowed empty string: False
Example: general
How to obtain or fill in: Select the default login role from this workspace's role list.
remark string Optional and may be an empty string; when omitted on creation, the constructed response may be null, and the database column has an empty string default; explicitly passing an empty string or valid text is recommended. Omitting it on modification clears it to "", rather than keeping it; the storage column is 512, and no unified upper limit is declared publicly.
Allowed null: False
Allowed empty string: True
Example: Enterprise login
How to obtain or fill in: The business party fills in a note describing the purpose.
tokenHoldTime integer Optional, 60..604800 seconds; if omitted on creation, the site default is used (repository baseline 604800 = 7 days); if omitted on modification, the old value is kept. This is not the cache code validity period, and this value must not be used to extend the one-time authentication code consumption window.
Allowed null: False
$minValue: 60
$maxValue: 604800
Example: 604800
How to obtain or fill in: Choose the number of seconds according to the organization's idle session retention policy.
tokenMaxValidDuration integer Optional, 60..2592000 seconds; if omitted on creation, the site default is used (repository baseline 2592000 = 30 days); if omitted on modification, it is kept. The older documentation's "30 days = 604800" is incorrect; this does not replace the idle retention duration.
Allowed null: False
$minValue: 60
$maxValue: 2592000
Example: 2592000
How to obtain or fill in: Choose the number of seconds according to the organization's maximum login session lifetime.
needNotify boolean Optional on create/modify, default true; false only suppresses the configuration reminder email and does not prevent configuration saving, cache refresh, or auditing. It does not disable SSO or prohibit user login.
Allowed null: False
Example: false
How to obtain or fill in: Whether to notify the workspace Owner/administrators of configuration changes; for batch rehearsals, explicitly set false according to the process.

Additional Parameter Notes

OIDC custom parameter mappings are used by stage:

Stage Supported variable values
authSet $state, $client_id, $client_secret, $redirect_uri, $scope, $response_type (code), $grant_type; do not put the secret in the browser URL
getTokenSet $state, $code, $client_id, $client_secret, $redirect_uri, $scope, $grant_type; for other keys, if they match a callback parameter name their value can be taken, otherwise they are treated as fixed text
getUserInfoSet $client_id, $client_secret, $redirect_uri, $scope, $access_token

A non-empty mapping object replaces the default request parameters and does not automatically fill in missing required items such as redirect_uri/code/scope. Saving only validates some URL/client fields and does not execute the full authentication flow; actual callbacks and final workspace access must be accepted on a dedicated test identity.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/sso/create' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"emailDomains":["example.com"],"idpName":"ExampleIdP","role":"general","remark":"Enterprise login","config":{"modeType":"expert","clientId":"client_example","clientSecret":"U0VDUkVULVBMQUNFSE9MREVS","scope":["openid","profile","email"],"grantType":"authorization_code","authSet":{"url":"https://idp.example.com/authorize"},"getTokenSet":{"url":"https://idp.example.com/token","method":"post","authMethod":"client_secret_basic"},"verifyTokenSet":{"url":"https://idp.example.com/jwks"},"getUserInfoSet":{"url":"https://idp.example.com/userinfo","method":"get","authMethod":"bearer","source":"origin"},"claimMapping":{"username":"preferred_username","email":"email","mobile":"phone_number"}},"tokenHoldTime":604800,"tokenMaxValidDuration":2592000,"needNotify":false,"type":"oidc"}'

Response

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

Field Type Description
content.id integer or null Current record number; the constructed result may be null before a new record is submitted.
content.uuid string sso_ configuration UUID.
content.type string saml/oidc.
content.workspaceUUID string The workspace it belongs to.
content.idpName string Provider display name.
content.remark string or null Note; may be null for old/new historical records.
content.role string Default role identifier.
content.idpMd5 string Provider identity/account namespace digest; not a client secret or writable ID.
content.tokenHoldTime integer Idle session retention in seconds.
content.tokenMaxValidDuration integer Maximum login session in seconds.
content.isOpenSAMLMapping integer or boolean Role mapping switch 1/0; not the same as the SSO configuration status.
content.status integer 0 enabled, 2 disabled; reads of non-deleted records may contain other historical statuses.
content.creator string Creator identity.
content.updator string Updater identity.
content.createAt integer Creation time in Unix seconds.
content.updateAt integer Update time in Unix seconds; may be -1 if never updated.
content.deleteAt integer Deletion time in Unix seconds; -1 if not deleted.
content.uploadData string The complete IdP metadata XML saved for SAML; normally an empty string for OIDC.
content.config object The complete configuration after saving; the OIDC write response still contains the stored ciphertext, not the Base64 asterisk mask from get, and it cannot be used for direct authentication or fill-back.
content.config.modeType string Optional easy/expert, default easy; this field mainly records the editing mode and does not automatically validate arbitrary expert configurations as executable.
content.config.wellKnowURL string Optional HTTP(S) discovery address; when provided, a real GET is performed and the JSON is parsed during the save phase (not an offline validation); request failures/SSL/HTTP errors return the errors on this page. If omitted, the auth/token/userinfo three endpoints must be specified explicitly; you cannot just set modeType=expert.
content.config.sslVerify boolean TLS verification switch for discovery requests. Defaults to true during the save phase; at runtime the SDK defaults to true for HTTPS and false for HTTP; it is not a global switch for each endpoint's verify.
content.config.clientId string Required for OIDC; must be a non-empty string without leading or trailing whitespace; obtained from the IdP client registration, not a Studio API Key.
content.config.clientSecret string In the OIDC write response this is the server-side stored ciphertext and cannot be sent back as Base64 plaintext/mask; to retain the secret on modification, call get first to obtain the mask.
content.config.grantType string Optional authorization_code/code; if omitted, the runtime default is authorization_code. It is not client_credentials or password authorization.
content.config.scope array Optional string array; at runtime the SDK defaults to only [openid], not openid/profile/email as in older documentation. Ensure the IdP actually provides the claims required by the account, such as email; an empty array produces an empty scope, so clients should configure it explicitly and sensibly.
content.config.scope[] string A single scope allowed by the IdP; it is not a permission point of this workspace.
content.config.authSet json Authorization redirect parameter object; may be omitted so that the address is filled in from the discovery document.
content.config.getTokenSet json Code-for-token request object; endpoints may be omitted and taken from the discovery document.
content.config.verifyTokenSet json JWK object for id_token signature verification; it does not initiate token authentication immediately in order to save the configuration.
content.config.getUserInfoSet json User information source/request object; defaults to origin, not id_token as in older documentation.
content.config.claimMapping json Mapping from account fields to the actual attribute names in the IdP; it is not a role mapping rule. OIDC saving does not strictly validate each item, so the callback must be tested in practice; a non-empty SAML mapping must provide non-empty username/email at the same time, and mobile is an optional string. An empty object is compatible with the old defaults.
content.config.authSet.url string Optional explicit HTTP(S) URL; if not provided, authorization_endpoint is taken from the discovery document; a value overrides the runtime endpoint. Without a discovery document, auth/token/userinfo are all required, and the signature verification source must separately ensure JWK availability.
content.config.authSet.paramMapping json Optional mapping for non-standard request parameters. When non-empty, it replaces the corresponding default parameter set, so required items must be fully retained; keys are IdP parameter names, and values can be $ variables allowed on this page or fixed strings. Do not map clientSecret into the authorization redirect URL.
content.config.authSet.paramMapping.Target parameter name string Dynamic IdP parameter value; the allowed variable range varies by stage, see the table below; unknown strings are kept as constants and are not automatically resolved from arbitrary internal context.
content.config.getTokenSet.url string Optional explicit HTTP(S) URL; if not provided, token_endpoint is taken from the discovery document; a value overrides the runtime endpoint. Without a discovery document, auth/token/userinfo are all required, and the signature verification source must separately ensure JWK availability.
content.config.getTokenSet.verify boolean Optional; for this endpoint, HTTPS defaults to true and HTTP to false; configured separately and not uniformly replaced by sslVerify.
content.config.getTokenSet.paramMapping json Optional mapping for non-standard request parameters. When non-empty, it replaces the corresponding default parameter set, so required items must be fully retained; keys are IdP parameter names, and values can be $ variables allowed on this page or fixed strings. Do not map clientSecret into the authorization redirect URL.
content.config.getTokenSet.paramMapping.Target parameter name string Dynamic IdP parameter value; the allowed variable range varies by stage, see the table below; unknown strings are kept as constants and are not automatically resolved from arbitrary internal context.
content.config.verifyTokenSet.url string Optional explicit HTTP(S) URL; if not provided, jwks_uri is taken from the discovery document; a value overrides the runtime endpoint. Without a discovery document, auth/token/userinfo are all required, and the signature verification source must separately ensure JWK availability.
content.config.verifyTokenSet.verify boolean Optional; for this endpoint, HTTPS defaults to true and HTTP to false; configured separately and not uniformly replaced by sslVerify.
content.config.getUserInfoSet.url string Optional explicit HTTP(S) URL; if not provided, userinfo_endpoint is taken from the discovery document; a value overrides the runtime endpoint. Without a discovery document, auth/token/userinfo are all required, and the signature verification source must separately ensure JWK availability.
content.config.getUserInfoSet.verify boolean Optional; for this endpoint, HTTPS defaults to true and HTTP to false; configured separately and not uniformly replaced by sslVerify.
content.config.getUserInfoSet.paramMapping json Optional mapping for non-standard request parameters. When non-empty, it replaces the corresponding default parameter set, so required items must be fully retained; keys are IdP parameter names, and values can be $ variables allowed on this page or fixed strings. Do not map clientSecret into the authorization redirect URL.
content.config.getUserInfoSet.paramMapping.Target parameter name string Dynamic IdP parameter value; the allowed variable range varies by stage, see the table below; unknown strings are kept as constants and are not automatically resolved from arbitrary internal context.
content.config.getTokenSet.method string Optional get/post, default post; only these two are supported at runtime; saving does not enforce this enumeration, and other values will cause errors on subsequent logins.
content.config.getTokenSet.authMethod string Optional basic/client_secret_basic (Basic header by default), client_secret_post (form contains ID and secret by default), none (only client_id by default, without automatically including the secret). When a custom paramMapping exists, parameters are generated from the complete mapping, and the Basic header still follows the selected authentication method.
content.config.getUserInfoSet.method string Default get. The current SDK's non-get branch still sends GET but places parameters in the Body, which is not a true POST; for an IdP that requires POST, do not assume support based solely on a successful save; use a verified GET endpoint instead.
content.config.getUserInfoSet.authMethod string Default bearer header; client_secret_basic uses the Basic header; none places access_token in parameters by default. The basic alias or any other value is not treated as equally effective.
content.config.getUserInfoSet.source string origin calls userinfo (default); id_token verifies and reads id_token; merge uses id_token first and then userinfo to override keys with the same name. Saving does not enforce the enumeration, and other values may ultimately yield no user information.
content.config.getUserInfoSet.responseInfoPath string Optional dot path to the user object in the response, extracted only for origin results; an empty string takes the entire response, which differs from the attribute name in claimMapping.
content.config.verifyTokenSet.keys array Optional array of public JWKs from the IdP; if non-empty, it is used directly for signature verification; otherwise a GET to verifyTokenSet.url is performed at runtime to obtain keys. These are not private keys; do not treat the example placeholder material as real signature verification configuration.
content.config.verifyTokenSet.keys[] json A single public JWK; retain the complete structure with the kty/alg/kid and public key parameters published by the IdP.
content.config.verifyTokenSet.keys[].kty string Public key type, such as RSA/EC; subject to the IdP JWK.
content.config.verifyTokenSet.keys[].kid string Identifier used to select the public key.
content.config.verifyTokenSet.keys[].use string Key usage.
content.config.verifyTokenSet.keys[].alg string Signature verification algorithm identifier.
content.config.verifyTokenSet.keys[].n string RSA modulus in Base64url.
content.config.verifyTokenSet.keys[].e string RSA public exponent in Base64url.
content.config.verifyTokenSet.keys[].crv string EC curve, only for the corresponding types.
content.config.verifyTokenSet.keys[].x string EC public x coordinate.
content.config.verifyTokenSet.keys[].y string EC public y coordinate.
content.config.verifyTokenSet.keys[].x5c array Array of public certificate chain in Base64 DER; optional.
content.config.verifyTokenSet.keys[].x5c[] string A single public certificate, without a private key.
content.config.verifyTokenSet.keys[].Other public fields JSON IdP JWK extensions are retained according to library protocol; do not add private key material such as d/p/q.
content.config.claimMapping.username string OIDC defaults to preferred_username; SAML defaults to username. When an explicit non-empty claimMapping is provided for SAML, this must be a non-empty string.
content.config.claimMapping.email string Defaults to email; an actual login must obtain a valid email. Required when an explicit non-empty claimMapping is provided for SAML; OIDC saving does not verify the value/source, but the callback still requires an email.
content.config.claimMapping.name string Optional display name attribute for OIDC, default name; SAML currently always reads name, and this mapping key does not change its display name extraction.
content.config.claimMapping.mobile string OIDC defaults to phone_number; SAML defaults to mobile; an explicit empty string means no extraction. If there is no number it is not added; an existing mobile number and area code are retained, and it is only added when the original account has no number and the IdP number is valid.
content.config.authSet.verify boolean Retained for compatibility and can be saved, but the current OIDC SDK does not consume this key and it cannot control requests/TLS; use the corresponding field that is actually read on this page.
content.config.verifyTokenSet.method string Retained for compatibility and can be saved, but the current OIDC SDK does not consume this key and it cannot control requests/TLS; use the corresponding field that is actually read on this page.
content.config.verifyTokenSet.authMethod string Retained for compatibility and can be saved, but the current OIDC SDK does not consume this key and it cannot control requests/TLS; use the corresponding field that is actually read on this page.
content.loginURL string Login entry for this provider, returned by the deployment site; not the current OpenAPI path accessed with DF-API-KEY.
content.callbackURL string OIDC callback URL only; must be registered in the IdP's allowed callback list.
content.metadataURL string SAML SP metadata address only.
content.entiryID string SAML SP entity ID only; keep the actual protocol spelling entiryID and do not change it to entityID.
content.assertionURL string SAML ACS/assertion callback address only; register according to the actual returned value.
content.emails array<string> Array of deduplicated allowlist values after creation.
content.emails[] string Full email or domain value.
content.declaration object or null Workspace common declaration attached to a non-empty business object; may be null or an empty object when not configured; an empty object is not added. For the exact position in pagination, refer to the structure on this page.
{
  "code": 200,
  "content": {
    "id": null,
    "uuid": "sso_example",
    "type": "oidc",
    "workspaceUUID": "wksp_example",
    "idpName": "ExampleIdP",
    "remark": "Enterprise login",
    "role": "general",
    "idpMd5": "IDP-IDENTITY-HASH",
    "tokenHoldTime": 604800,
    "tokenMaxValidDuration": 2592000,
    "isOpenSAMLMapping": 0,
    "status": 0,
    "creator": "wsak_example",
    "updator": "wsak_example",
    "createAt": 1785427200,
    "updateAt": 1785427200,
    "deleteAt": -1,
    "config": {
      "modeType": "expert",
      "clientId": "client_example",
      "clientSecret": "STORED-CIPHERTEXT-PLACEHOLDER",
      "scope": [
        "openid",
        "profile",
        "email"
      ],
      "grantType": "authorization_code",
      "authSet": {
        "url": "https://idp.example.com/authorize"
      },
      "getTokenSet": {
        "url": "https://idp.example.com/token",
        "method": "post",
        "authMethod": "client_secret_basic"
      },
      "verifyTokenSet": {
        "url": "https://idp.example.com/jwks"
      },
      "getUserInfoSet": {
        "url": "https://idp.example.com/userinfo",
        "method": "get",
        "authMethod": "bearer",
        "source": "origin"
      },
      "claimMapping": {
        "username": "preferred_username",
        "email": "email",
        "mobile": "phone_number"
      }
    },
    "uploadData": "",
    "loginURL": "https://sso.example.com/oidc/login/sso_example",
    "callbackURL": "https://sso.example.com/oidc/callback/sso_example",
    "declaration": {},
    "emails": [
      "example.com"
    ]
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

SAML request example: first replace <IdP_METADATA_XML> with the complete valid XML provided by the administrator (do not save using this placeholder text directly). The modification target must originally be SAML.

curl --request POST '<Endpoint>/api/v1/sso/create' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"emailDomains":["example.com"],"idpName":"ExampleSAML","role":"general","remark":"SAML login","idpData":"<IdP_METADATA_XML>","config":{"claimMapping":{"username":"uid","email":"mail","mobile":"telephone"}},"needNotify":false,"type":"saml"}'

Example of a successful OIDC configuration response (the secret is a stored ciphertext placeholder and cannot be filled back):

{
  "code": 200,
  "content": {
    "id": null,
    "uuid": "sso_example",
    "type": "oidc",
    "workspaceUUID": "wksp_example",
    "idpName": "ExampleIdP",
    "remark": "Enterprise login",
    "role": "general",
    "idpMd5": "IDP-IDENTITY-HASH",
    "tokenHoldTime": 604800,
    "tokenMaxValidDuration": 2592000,
    "isOpenSAMLMapping": 0,
    "status": 0,
    "creator": "wsak_example",
    "updator": "wsak_example",
    "createAt": 1785427200,
    "updateAt": 1785427200,
    "deleteAt": -1,
    "config": {
      "modeType": "expert",
      "clientId": "client_example",
      "clientSecret": "STORED-CIPHERTEXT-PLACEHOLDER",
      "scope": [
        "openid",
        "profile",
        "email"
      ],
      "grantType": "authorization_code",
      "authSet": {
        "url": "https://idp.example.com/authorize"
      },
      "getTokenSet": {
        "url": "https://idp.example.com/token",
        "method": "post",
        "authMethod": "client_secret_basic"
      },
      "verifyTokenSet": {
        "url": "https://idp.example.com/jwks"
      },
      "getUserInfoSet": {
        "url": "https://idp.example.com/userinfo",
        "method": "get",
        "authMethod": "bearer",
        "source": "origin"
      },
      "claimMapping": {
        "username": "preferred_username",
        "email": "email",
        "mobile": "phone_number"
      }
    },
    "uploadData": "",
    "loginURL": "https://sso.example.com/oidc/login/sso_example",
    "callbackURL": "https://sso.example.com/oidc/callback/sso_example",
    "declaration": {},
    "emails": [
      "example.com"
    ]
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Response

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 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 Fix the JSON according to content.reason, line, and column.
400 ft.JsonFormatError The top level of the Body is not a JSON object Some json file format error Submit a complete object containing the fields on this page.
406 ft.ParameterValidationFailed The SAML claimMapping structure is invalid, or a declared field type/enumeration/range does not match Parameter parsing failed For a non-empty SAML mapping, provide non-empty username/email at the same time; mobile must be a string; fix according to the public parameter table.
400 ft.InvalidSsoRoleCfg The default role is owner/wsAdmin Administrator and owner role configurations are not supported Use general/readOnly or an active custom role in this workspace.
400 ft.InvalidCustomRole The default custom role does not exist, is disabled/deleted, or is not visible in the current workspace Invalid custom role Take a valid role from the current workspace's role list; do not use the display name.
406 ft.InvalidOIDC OIDC creation has no non-empty config Invalid OIDC configuration Submit the complete client and endpoint configuration.
406 ft.InvalidSAML SAML lacks valid XML, the metadata lacks entity/service/key descriptions, or a non-empty config is modified without providing valid idpData Invalid saml configuration Download the real complete metadata XML from the IdP; when updating field mappings, provide the original valid XML at the same time.
400 ft.SsoModeTypeInvalid OIDC modeType is not easy/expert Invalid modeType parameter Choose according to the enumeration on this page.
400 ft.SsoClientIdInvalid clientId is empty/not a string, or has leading or trailing whitespace Invalid clientId parameter Use the original client ID assigned by the IdP.
400 ft.SsoClientSecretInvalid clientSecret is not valid Base64 UTF-8, is empty/all asterisks after decoding on creation, or a non-empty config lacks a valid clientSecret string Invalid clientSecret parameter For creation, encode the real secret; to retain the old value on modification, use the Base64 asterisk mask returned by get, and do not fill back the stored ciphertext.
400 ft.SsoSSLVerifyInvalid SSL verification of the discovery document request failed during saving SSL verification exception: {} Check the certificate chain/domain and trust, and configure sslVerify according to organizational policy.
400 ft.SsoWellKnowURLInvalid wellKnowURL is not a valid HTTP(S) address, or the discovery request returns HTTP >= 400 Invalid identity provider URL (wellKnowURL) parameter Verify the production discovery address and service response; do not substitute the login page URL.
400 ft.SsoVerifyWellKnowURLInvalid The discovery request failed to connect/parse JSON, etc. Failed to verify identity provider URL (wellKnowURL) parameter, err:{} Check the address, network, and JSON response, keep the traceId, and do not repeatedly submit the same incorrect configuration.
400 ft.SsoAuthSetInvalid The explicit authSet.url is not a valid HTTP(S) address Invalid {} parameter Use the production authorization_endpoint.
400 ft.SsoTokenEndPointInvalid The explicit getTokenSet.url is invalid Invalid {} parameter Use the production token_endpoint.
400 ft.SsoVerifyTokenSetInvalid The explicit verifyTokenSet.url is invalid Invalid {} parameter Use the production JWKS address.
400 ft.SsoUserInfoEndPointInvalid The explicit getUserInfoSet.url is invalid Invalid {} parameter Use the production userinfo_endpoint.
400 ft.SsoOIDCUrlsInvalid No wellKnowURL and the auth/token/userinfo three endpoints are incomplete Invalid url parameter Complete all three production addresses; saving does not mean the whole protocol has been accepted.
400 ft.SsoGrantTypeInvalid grantType is not authorization_code/code Invalid grantType; currently only code and authorization_code are supported Change to a supported authorization method.
400 ft.SSOEsistsSameSupplier A non-deleted provider name is duplicated in the same workspace, excluding itself on modification A provider with the same name already exists Modify using the existing UUID or choose a unique name.
400 ft.SSOEsistsSameIdp A non-deleted configuration in the same workspace has the same IdP identity digest, excluding itself on modification A configuration with the same metadata file already exists Check the existing providers and do not create the same identity again by changing the display name.
500 ft.InternalServerError An unhandled exception occurred in the dynamic config or email element shape, storage, key encryption, XML tooling, or post-submit cache tasks/auditing Internal error The creation may already have been committed. First locate it by idpName in this workspace's SSO list, then use get to verify the configuration and allowlist; if it already exists, handle the unfinished steps and do not blindly create it again. Keep the traceId.
400 ft.SSOCfgExceedQuantityLimit After adding, the number of configurations for the protocol exceeds the site limit (disabled but not deleted ones also count) The number of SSO configurations exceeds the limit Check the count in the SSO list and the historical configurations that can be deleted; the site default is 10 per type, and the actual upper-limit configuration prevails.

Feedback

Is this page helpful?