ExtlClntAppSamlConfigurablePolicies defines Security Assertion Markup Language (SAML) policies for an external client app with Salesforce acting as the identity provider. Users sign in to a third-party service provider using their Salesforce credentials. The policy controls user identification, trust in incoming SAML requests, assertion encryption, additional attributes sent to the service provider, and single logout.
This component is separate from the parent ExternalClientApplication and its app-wide ExtlClntAppConfigurablePolicies component. The app-wide policy enables the SAML plugin and controls post-authentication routing. The SAML policy also contains end-user access settings that apply to the entire app, not just its SAML configuration.
Key Elements
| Element | What the Element Controls |
|---|---|
externalClientApplication |
Required. Identifies the parent external client app by its label. |
acsUrl |
Required. The assertion consumer service (ACS) endpoint where the service provider receives SAML responses from Salesforce. |
entityUrl |
Required. The service provider's globally unique entity ID. It identifies the service provider; it is not the response-delivery endpoint. |
issuer |
Identifies Salesforce to the service provider. Defaults to the My Domain URL when omitted; it can specify another value, such as an Experience Cloud site URL. |
subjectType |
Selects the user's single sign-on (SSO) identifier. Enumerated values are Username, FederationId, UserId, CustomAttribute, PersistentId, and SpokeId. SAML behavior for SpokeId is not documented. |
subjectCustomAttribute |
Identifies the field on User to use when subjectType is CustomAttribute. An existing field or a custom User field can supply the value. |
nameIdFormat |
Sets the format of the selected identifier in SAML messages. Values are Unspecified, EmailAddress, Persistent, and Transient. The default is Unspecified. |
certificate |
The service provider's request-signing certificate. Including it makes Salesforce require signed SAML requests from that service provider. Omitting it allows both signed and unsigned requests. |
encryptionCertificate, encryptionType
|
Control encryption of outgoing assertions. Use an X.509 certificate saved in Certificate and Key Management. Encryption methods are AES_128 and AES_256. |
signingAlgorithmType |
Selects SHA1 or SHA256 for Salesforce's outgoing SAML signatures, including single logout messages. |
customAttributes |
Adds attributes to outgoing assertions. Each entry requires a unique key and a formula formatted as $<object name>.<field>. |
commaSeparatedPermissionSet, commaSeparatedProfile
|
Contain comma-separated permission set IDs and profile IDs defining end-user access requirements for the entire app. These values are record IDs, not developer names. |
singleLogoutUrl |
The service provider endpoint to which Salesforce sends logout requests when Salesforce initiates logout. |
singleLogoutBindingType |
Controls how the service provider initiates logout toward Salesforce: PostBinding uses POST; RedirectBinding uses browser-based GET requests. |
Behavior and Constraints
Parent configuration and access
The policy requires a parent ExternalClientApplication whose distributionState is Local. External client apps with SAML configurations cannot be packaged. The parent must also have an associated ExtlClntAppConfigurablePolicies component with isSamlPluginEnabled set to true.
Using this metadata type requires the user permission "View all External Client Apps, view their settings, and edit their policies." That administrative permission is distinct from an end user's access to the app. End-user access requirements come from commaSeparatedPermissionSet and commaSeparatedProfile. Permission sets are recommended instead of profiles for managing user permissions.
User identification
subjectType chooses the identifier's source:
-
Usernameuses the Salesforce username. -
FederationIdusesUser.FederationIdentifier. Its value must be recognizable to both Salesforce and the service provider. -
UserIduses the 15-character Salesforce user ID. -
CustomAttributerequiressubjectCustomAttributeto identify a field onUser. Selecting a custom User field introduces aCustomFielddependency. -
PersistentIduses an opaque identifier recognized by Salesforce and the service provider. -
SpokeIdis an enumerated value, but its SAML behavior is not documented.
nameIdFormat is separate from subjectType: it controls the identifier's format in SAML messages, not which user field supplies it. Unspecified declares no format, and EmailAddress formats the identifier as an email address. Persistent describes a stable opaque identifier; Transient describes a temporary opaque identifier that can change. The format must match what the service provider expects. Check both settings when diagnosing user-matching failures.
Request trust, encryption, and signing
certificate controls trust in incoming requests for service provider-initiated SAML flows. Include it when the service provider signs SAML requests and you want to use that flow. Its presence changes the trust policy: Salesforce requires all SAML requests from that service provider to be signed. Without it, Salesforce accepts signed and unsigned requests.
encryptionCertificate has a different role: it encrypts assertions that Salesforce sends to the service provider. The service provider must be configured to decrypt them. encryptionType selects AES_128 or AES_256 when an encryption certificate is configured.
signingAlgorithmType controls Salesforce's outgoing signatures. Salesforce includes signatures in both the SAML response body and the assertion, and applies the selected algorithm to single logout requests and responses as well.
Attributes, logout, and routing
customAttributes sends additional information separately from the identifier selected by subjectType. Each entry's formula identifies the data disclosed to the service provider, such as $User.Country or $Organization.Country. The required key uniquely names the attribute. These entries are contained policy settings, not separate deployable components.
The logout settings describe opposite directions. singleLogoutUrl is the destination on the service provider when Salesforce initiates logout. singleLogoutBindingType describes how the service provider sends logout requests to Salesforce.
Configure the destination after authentication with startUrl on the associated ExtlClntAppConfigurablePolicies component.
Deployment and Retrieval
Components use the .ecaSamlPlcy suffix and reside in the extlClntAppSamlConfigurablePolicies folder. The type inherits fullName from Metadata.
The package.xml manifest supports the * wildcard for ExtlClntAppSamlConfigurablePolicies. A manifest can select this type together with ExternalClientApplication and ExtlClntAppConfigurablePolicies. Manifest-based deployment and retrieval do not remove the packaging restriction: the parent app must remain Local.
In the destination org, the parent app and its associated app-wide policy must satisfy the SAML prerequisites. The required externalClientApplication value identifies the parent by its label. If subjectCustomAttribute selects a custom User field, that field is a deployment dependency. Assertion encryption also depends on the configured certificate in Certificate and Key Management.
When moving policies between orgs, account for the record IDs in commaSeparatedPermissionSet and commaSeparatedProfile. They are not developer-name references; the IDs must identify the intended permission sets and profiles in the destination org.
Relationships
The SAML policy connects the parent app to service-provider identity settings, an assertion-encryption certificate, and optionally a custom User field. The separate ExtlClntAppConfigurablePolicies component supplies the SAML enablement prerequisite and post-authentication startUrl; it is not a contained child of this SAML policy.
References
-
Certificate:encryptionCertificate. -
ExternalClientApplication:externalClientApplication, using the parent app's label. -
CustomField:subjectCustomAttribute, when the selected identifier comes from a custom User field.
Common Questions
Can I package an external client app with SAML policies?
No. External client apps with SAML configurations cannot be packaged, and the parent's distributionState must be Local. The SAML policy still supports deployment and retrieval through a package.xml manifest, including wildcard selection.
Why does Salesforce accept unsigned SAML requests?
If certificate is omitted, Salesforce accepts both signed and unsigned requests. Including the service provider's request-signing certificate makes Salesforce require signed requests from that service provider. encryptionCertificate does not control incoming request trust.
What is the difference between subjectType and nameIdFormat?
subjectType selects the user's identifier, such as the Salesforce username or User.FederationIdentifier. nameIdFormat specifies how that identifier is formatted in SAML messages and must match the service provider's expected format.
Do permission set and profile settings apply only to SAML?
No. commaSeparatedPermissionSet and commaSeparatedProfile define end-user access requirements for the entire external client app. Both contain record IDs rather than developer names.
Where do I set the page users reach after SAML login?
Set startUrl on the associated ExtlClntAppConfigurablePolicies component. This routing setting is separate from acsUrl, which is the service provider endpoint that receives SAML responses.