API ReferenceManagementOauth Management
POST
/v1/mgmt/oauth/provider

Authorization

Descope Project ID and Management Key
AuthorizationBearer <token>

Project ID:Management Key as bearer token.

In: header

Request Body

application/json

id*string
Length1 <= length <= 254
enabled?boolean
useSelfAccount?boolean

Whether logins use the caller's own OAuth app credentials rather than Descope's shared app; always true for custom providers

clientId?string
Lengthlength <= 254
clientSecret?string

Write-only. Read returns PLACEHOLDER_VALUE when set. PLACEHOLDER_VALUE=keep, ""=clear (rejected when required), value=set

Lengthlength <= 4096
callbackDomain?string
Lengthlength <= 254
redirectUrl?string
scopes?object

Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.

prompts?unknown

Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.

allowedGrantTypes?unknown

Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.

manageProviderTokens?boolean
trustProvidedEmails?boolean
jitUpdatesDisabled?boolean
useNonce?boolean

Has no effect on the authorization code flow. Set strictOIDCValidation to send and verify a nonce.

useClientAssertion?boolean
description?string

Configuration fields for custom providers; Descope-managed and rejected on system provider writes

Lengthlength <= 254
logo?string
Lengthlength <= 2097152
issuer?string
authUrl?string
tokenUrl?string
userDataUrl?string
jwksUrl?string
userDataClaimsMapping?object

Note that this is used both in SSO settings and in OAuth settings import/export, make sure not to change any fields which might break backwards compatibility with existing exported project data

nativeClientId?string

Native (mobile) client credentials

Lengthlength <= 254
nativeClientSecret?string

Write-only. Read returns PLACEHOLDER_VALUE when set. PLACEHOLDER_VALUE=keep, ""=clear (rejected when required), value=set

Lengthlength <= 4096
appleKeyGenerator?object

Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.

nativeAppleKeyGenerator?unknown

Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.

clientAssertionSigningAlg?string

Algorithm signing the private_key_jwt client assertion when useClientAssertion is set. RS256 (default when empty) or RS512; the IdP must be registered with the same algorithm

strictOIDCValidation?boolean

Sends a nonce on the authorization code flow and requires it in the ID token, and rejects an ID token whose audience is not the client ID. Requires jwksUrl and issuer so the ID token is verified. Native and One Tap logins are not affected

signAlgorithm?string

Algorithm the provider signs its ID tokens with, verified against the keys at jwksUrl. Required when jwksUrl is set, so strictOIDCValidation needs it too. Descope-managed and rejected on system provider writes

authUrlAdditionalParams?object

Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.

Create or update a single OAuth provider, using a valid management key.

curl -X POST "https://api.descope.com/v1/mgmt/oauth/provider" \  -H "Content-Type: application/json" \  -d '{    "id": "string"  }'
{  "id": "string",  "enabled": true,  "useSelfAccount": true,  "clientId": "string",  "clientSecret": "string",  "callbackDomain": "string",  "redirectUrl": "string",  "scopes": null,  "prompts": null,  "allowedGrantTypes": null,  "manageProviderTokens": true,  "trustProvidedEmails": true,  "jitUpdatesDisabled": true,  "useNonce": true,  "useClientAssertion": true,  "description": "string",  "logo": "string",  "issuer": "string",  "authUrl": "string",  "tokenUrl": "string",  "userDataUrl": "string",  "jwksUrl": "string",  "userDataClaimsMapping": {    "loginId": "string",    "username": "string",    "name": "string",    "email": "string",    "verifiedEmail": "string",    "verifiedPhone": "string",    "picture": "string",    "givenName": "string",    "middleName": "string",    "familyName": "string",    "customAttributes": {      "property1": "string",      "property2": "string"    },    "group": "string"  },  "nativeClientId": "string",  "nativeClientSecret": "string",  "appleKeyGenerator": null,  "nativeAppleKeyGenerator": null,  "clientAssertionSigningAlg": "string",  "strictOIDCValidation": true,  "signAlgorithm": "string",  "authUrlAdditionalParams": null}
/** * Single OAuth provider (Terraform: descope_oauth_provider). The id is the provider identity: the lowercase *  name of a system provider ("google"), or the caller-chosen key of a custom provider. Patch semantics: *  omitted fields are left untouched; present fields are written. The Get response uses the same message with *  all fields populated, except that Descope-managed fields of system providers (description, logo, issuer, *  the connection endpoints and the claims mapping) are rejected on write and omitted on read. */export interface Response {id: stringenabled?: boolean/** * Whether logins use the caller's own OAuth app credentials rather than Descope's shared app; always true for custom providers */useSelfAccount?: booleanclientId?: string/** * Write-only. Read returns PLACEHOLDER_VALUE when set. PLACEHOLDER_VALUE=keep, ""=clear (rejected when required), value=set */clientSecret?: stringcallbackDomain?: stringredirectUrl?: string/** * JSON arrays of strings; Value makes empty and absent distinct: null/absent = keep, [] = clear, values = set. Validated in the service */scopes?: {[k: string]: unknown}/** * Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. */prompts?: {[k: string]: unknown}/** * Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. */allowedGrantTypes?: {[k: string]: unknown}manageProviderTokens?: booleantrustProvidedEmails?: booleanjitUpdatesDisabled?: boolean/** * Has no effect on the authorization code flow. Set strictOIDCValidation to send and verify a nonce. */useNonce?: booleanuseClientAssertion?: boolean/** * Configuration fields for custom providers; Descope-managed and rejected on system provider writes */description?: stringlogo?: stringissuer?: stringauthUrl?: stringtokenUrl?: stringuserDataUrl?: stringjwksUrl?: string/** * Replaced wholesale when present, left untouched when absent */userDataClaimsMapping?: {loginId?: stringusername?: stringname?: stringemail?: stringverifiedEmail?: stringverifiedPhone?: stringpicture?: stringgivenName?: stringmiddleName?: stringfamilyName?: stringcustomAttributes?: {[k: string]: string}group?: string}/** * Native (mobile) client credentials */nativeClientId?: string/** * Write-only. Read returns PLACEHOLDER_VALUE when set. PLACEHOLDER_VALUE=keep, ""=clear (rejected when required), value=set */nativeClientSecret?: string/** * JSON objects with the AppleKeyGenerator fields (keyId, teamId, privateKey); Value makes empty and absent *  distinct: null/absent = keep, {} = clear, object = set. Only valid for the apple system provider. Validated in the service */appleKeyGenerator?: {[k: string]: unknown}/** * Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. */nativeAppleKeyGenerator?: {[k: string]: unknown}/** * Algorithm signing the private_key_jwt client assertion when useClientAssertion is set. RS256 (default when empty) or RS512; the IdP must be registered with the same algorithm */clientAssertionSigningAlg?: string/** * Sends a nonce on the authorization code flow and requires it in the ID token, and rejects an ID token whose audience is not the client ID. Requires jwksUrl and issuer so the ID token is verified. Native and One Tap logins are not affected */strictOIDCValidation?: boolean/** * Algorithm the provider signs its ID tokens with, verified against the keys at jwksUrl. Required when jwksUrl is set, so strictOIDCValidation needs it too. Descope-managed and rejected on system provider writes */signAlgorithm?: string/** * JSON object of static string parameters added to the authorization request, such as {"acr_values": "AAL3_ANY"} for NHS CIS2 or {"vtr": "[\"P9.Cp.Cd\"]"} for NHS login. Value makes empty and absent distinct: null/absent = keep, {} = clear, object = replace. Validated in the service */authUrlAdditionalParams?: {[k: string]: unknown}}
Was this helpful?