ExtlClntAppGlobalOauthSettings defines the global OAuth authorization settings for an external client app, including its consumer identity, secret, authentication-flow controls, and token configuration. It contains private and sensitive OAuth consumer information, cannot be packaged, and must not be added to source control.
This component is separate from the ExternalClientApplication app definition and the app's other OAuth settings and policy components. Its required externalClientApplication element references the app by name. Global settings alone do not describe the app's complete authorization configuration.
Key Elements
| Element | What the Element Controls |
|---|---|
externalClientApplication |
Required. The name of the associated ExternalClientApplication, not a record ID. |
consumerKey |
The OAuth client_id used to identify the consumer to Salesforce. |
consumerSecret |
The OAuth client_secret paired with the consumer key. |
callbackUrl |
The callback endpoint, corresponding to OAuth redirect_uri. |
certificate |
A PEM-encoded certificate string. Providing it enables the JWT Bearer flow; it does not select the access-token format. |
isPkceRequired |
Requires Proof Key for Code Exchange (PKCE), a protection for authorization-code exchanges, when true. Defaults to true; false makes PKCE optional. |
isConsumerSecretOptional |
Controls the client-secret requirement when exchanging for an access token in the OAuth 2.0 web server flow. Defaults to false, requiring the secret. |
isSecretRequiredForRefreshToken |
Requires the client secret for refresh-token and hybrid refresh-token flows when true, the default. When false, a supplied secret is still validated. |
isTokenExchangeEnabled |
Enables the token exchange flow when true. |
isSecretRequiredForTokenExchange |
Requires the client secret for token exchange when true. This is separate from enabling the flow. |
isNamedUserJwtEnabled |
Selects JSON Web Token (JWT)-based access tokens when true. Defaults to false, which selects opaque access tokens. |
idTokenConfig |
Nested settings for ID-token content, audiences, and lifetime. These settings do not select the access-token format. |
shouldRotateConsumerKey |
Replaces the consumer key with a newly generated key on metadata deployment when true. Defaults to false; rotation requires the deployment option to ignore warnings. |
shouldRotateConsumerSecret |
Replaces the consumer secret with a newly generated secret on metadata deployment when true. Defaults to false; rotation requires the deployment option to ignore warnings. |
isRefreshTokenRotationEnabled |
Enables refresh-token rotation when true. This is separate from rotating the consumer key or secret. |
Behavior and Constraints
Access prerequisites
The org must enable Allow Access to OAuth Consumer Secrets via Metadata API in Setup. Users with developer roles also need the View External Client Apps Consumer Secrets in Metadata user permission to configure global OAuth settings.
These prerequisites govern access to sensitive metadata. They are separate from the fields that enable OAuth flows or require client secrets during authentication.
Flow enablement and secret requirements
PKCE and the web server flow's client-secret requirement are independent. Setting isConsumerSecretOptional to true does not make PKCE optional; isPkceRequired still defaults to true.
Refresh-token requests have their own control, isSecretRequiredForRefreshToken. Making the secret optional for the web server flow does not change that setting. Also, optional does not mean ignored: if a refresh-token request supplies a secret, Salesforce validates it even when the refresh-token secret requirement is disabled.
Token exchange likewise separates flow enablement from credential requirements: isTokenExchangeEnabled enables the flow, while isSecretRequiredForTokenExchange controls whether it requires the client secret. The client credentials and device flows have separate switches, isClientCredentialsFlowEnabled and isDeviceFlowEnabled.
Headless authentication flows
isCodeCredFlowEnabled enables the Authorization Code and Credentials Flow and its variations for headless login, passwordless login, and guest user identity services in an off-platform app. It defaults to false. The flow must also be enabled org-wide in OAuth and OpenID Connect settings. Headless registration is not supported for external client apps.
isCodeCredPostOnly applies only when the Authorization Code and Credentials Flow is enabled for the app. When true, the app must send user credentials in the POST body to services/oauth2/authorize. Its default, false, permits POST or GET requests with credentials in the request body or a Basic authorization header.
Token format and introspection
A certificate enables certificate-based authentication through the JWT Bearer flow. isNamedUserJwtEnabled instead determines whether the resulting access tokens use JWT format or an opaque format. Enabling one does not describe the other.
isIntrospectAllTokens controls the scope of token introspection, which lets an app inspect token information. Its default, false, limits the app to introspecting its own tokens. Setting it to true authorizes introspection of all access and refresh tokens.
ID-token configuration
Within idTokenConfig, idTokenIncludeAttributes controls inclusion of attributes, and idTokenIncludeStandardClaims controls inclusion of standard claims about the authentication event. These are ID-token content settings, not access-token format settings.
idTokenAudience identifies the intended audience using case-sensitive audience strings. With no additional audiences, the audience is the relying party's client_id, meaning the client ID of the app consuming the ID token. Additional audiences appear alongside client_id in the aud claim; they do not replace it.
idTokenValidityInMinutes has a documented range of 1-720 minutes and a default of 2 minutes. The audience field's representation and the sample lifetime value have documentation inconsistencies described below.
Deployment and Retrieval
Components use the .ecaGlblOauth suffix and reside in the extlClntAppGlobalOauthSets directory. The type inherits the metadata fullName field. In package.xml, use ExtlClntAppGlobalOauthSettings as the type name; wildcard member selection with * is supported.
A deployment or retrieval manifest is not an installable package. Manifest support does not override this type's nonpackageable status. A managed package being created successfully is also not proof that it can be installed or upgraded when it contains this component.
Credential rotation is a deployment action. Setting shouldRotateConsumerKey or shouldRotateConsumerSecret to true requests a newly generated replacement credential on metadata deployment. Either request requires the deployment option to ignore warnings. Leaving a flag enabled leaves a credential-replacement request in the deployment configuration. Both flags default to false.
Do not confuse those deployment actions with isRefreshTokenRotationEnabled, which controls refresh-token rotation. Also, a successful deployment does not by itself establish that the destination credentials match submitted consumerKey and consumerSecret values; a cross-org migration report describes different behavior below.
Relationships
The direct reference connects these global settings to the external client app. Companion components include ExtlClntAppOauthSettings, ExtlClntAppOauthConfigurablePolicies, and ExtlClntAppConfigurablePolicies. They hold separate settings or policies; they are not nested fields of this component, and listing them together in a manifest does not establish a mandatory deployment sequence.
References
-
ExternalClientApplication:externalClientApplication, the required app name.
Documentation Inconsistencies
-
The ID-token audience representation is ambiguous. The field type for
idTokenAudienceisstring, but its description calls the value an array of case-sensitive strings. The documented audience behavior is additive: supplied audiences accompanyclient_idrather than replacing it. The type description does not resolve the array-versus-string representation. -
The sample ID-token lifetime conflicts with the documented range. The Salesforce sample sets
idTokenValidityInMinutesto0, while the field description permits 1-720 minutes and gives a default of 2. No special meaning for0is documented; the sample does not establish it as a supported lifetime.
Reported Issues
-
A successfully created managed package reportedly failed installation or upgrade. In a March-April 2026 report, a second-generation managed package (2GP) included
ExtlClntAppGlobalOauthSettings, but installation rejected that component type. The poster reported that Salesforce Support described the rejection as expected. This is consistent with the type's nonpackageable status. Package installation discussion. -
Submitted consumer credentials were reportedly ignored despite a successful deployment. In July 2026, during migration of a managed-package integration, the poster supplied fixed
consumerKeyandconsumerSecretvalues but reported that Salesforce generated credentials for the destination org instead. This report does not establish that metadata deployment can preserve a single credential pair across arbitrary orgs. Cross-org credential discussion. - Deploying a packaged external client app into a scratch org was reportedly rejected. The same July 2026 migration report included a deployment failure stating that ephemeral orgs such as scratch orgs could not be used to deploy packaged external client apps. This describes the attempted deployment model, not every way a scratch org can reference an existing app. Scratch-org deployment report.
-
A package-version build from a different Dev Hub reportedly failed. In that July 2026 discussion, the poster also described an
ExternalClientApplicationretrieval failure when building from a Dev Hub other than the app's origin. The reported error treated the app as created in an ephemeral org. This is a conditional pipeline report, not a general rule about this global-settings component's deployment identity. Cross-Dev-Hub build report. -
Referencing an existing packaged app reportedly preserved its credentials in Partner Developer scratch orgs. A non-accepted answer in July 2026 described a different model: create a Packaged external client app in a persistent Dev Hub, then reference it through
ExternalClientApplicationandExtlClntAppOauthSettingsmetadata rather than recreate it. The answer reported inherited credentials in Partner Developer scratch orgs. It did not establish equivalent behavior for Developer Edition orgs or arbitrary cross-Dev-Hub pipelines. Existing-app reference approach. -
Omitting global settings reportedly left the OAuth plugin unable to load in Setup. In the same July 2026 migration scenario, excluding
ExtlClntAppGlobalOauthSettingsled to a plugin-loading error identifying a nulloauthLink. That is a diagnostic clue for that scenario, not a general requirement to include this sensitive component in every deployment. OAuth plugin loading report.
Common Questions
Can ExtlClntAppGlobalOauthSettings be included in a managed package?
No. It contains sensitive OAuth consumer information and is nonpackageable. Wildcard support in package.xml concerns metadata selection, not package installability. A 2026 report describes package creation succeeding but installation or upgrade rejecting this component.
What permissions are needed to access global OAuth settings through Metadata API?
Enable Allow Access to OAuth Consumer Secrets via Metadata API in Setup. Users with developer roles also need View External Client Apps Consumer Secrets in Metadata to configure these settings.
Why did deployment replace my external client app's consumer key or secret?
Check shouldRotateConsumerKey and shouldRotateConsumerSecret. A true value requests replacement on deployment and requires the option to ignore warnings. Separately, a cross-org migration report describes generated destination credentials even when fixed credential values were submitted.
Does making the client secret optional also disable PKCE?
No. isConsumerSecretOptional controls the web server flow's secret requirement, while isPkceRequired independently controls PKCE and defaults to true. Refresh-token and token-exchange secret requirements also have separate fields.
Can I keep the same consumer key and secret across scratch orgs?
Do not assume that submitting the same credentials will preserve them. A non-accepted community answer reports success by referencing an existing Packaged app from a persistent Dev Hub in Partner Developer scratch orgs. That report does not establish support for Developer Edition orgs or arbitrary cross-Dev-Hub pipelines.