Repository navigation
feat(connections): support XAA requesting app options on samlp connections - #1535
Open
harshithRai wants to merge 2 commits into
Open
harshithRai wants to merge 2 commits into
harshithRai wants to merge 2 commits into
Conversation
…tions Allow token_endpoint_auth_signing_alg and token_endpoint_jwtca_aud_format on samlp connections so the Cross App Access requesting app options (client_id, client_secret, discovery_url, oidc_metadata, token_endpoint_*) can be deployed. id_token_* options stay oidc/okta only. Also keep the stored options.client_secret when the exported ##CONNECTIONS_<STRATEGY>_SECRET## placeholder is left unresolved. Auth0 replaces options as a whole on update, so the placeholder was stripped and the stored secret was cleared on re-import. Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1535 +/- ##
==========================================
+ Coverage 82.64% 82.67% +0.02%
==========================================
Files 193 193
Lines 9301 9315 +14
Branches 2061 2065 +4
==========================================
+ Hits 7687 7701 +14
Misses 816 816
Partials 798 798 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Only reuse a stored options.client_secret when the stored connection has the same name and strategy, and log a warning naming the keyword mapping to define when the stored secret is reused. Export isUnresolvedPlaceholder from utils instead of the raw regex, and correct the comment and warning in stripUnresolvedPlaceholders, which claimed a dropped field keeps its stored value even when the API replaces the parent object. Add tests for the strategy match, the warning, a non-samlp strategy, an explicit null client_secret, and the payload handed to the update call. Document the samlp options, the shared secret placeholder, and the behavior when the feature is later disabled on a tenant. Co-Authored-By: Claude <noreply@anthropic.com>
harshithRai
marked this pull request as ready for review
November 13, 2026 08:35
ankita10119
reviewed
Nov 17, 2026
ankita10119
left a comment
Contributor
There was a problem hiding this comment.
A few non-blocking follow-ups:
- Other placeholders in options can still be wiped. For example, if
options.signingCert: "##SAML_CERT##"on asamlpconnection is left unresolved, it's still removed from the update and the stored cert is wiped, because options is replaced as a whole. Keeping this PR toclient_secretis fine. Could we open a follow-up to restore any removedoptions.*field from the stored connection? - Minor:
- With
AUTH0_DRY_RUN_APPLY, the"Reusing…"warning is logged twice per connection, once for the preview and once for the apply. - The
withOptions+ restore block is now duplicated incalcChangesanddryRunChanges. A small shared helper would tidy that up.
- With
- Test gap: a test that combines
EXCLUDED_PROPS: { connections: ['options.client_secret'] }with the placeholder would be good. I checked it locally and the stored secret is sent as expected, but it isn't covered in the suite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 Changes
Enables the Cross App Access requesting app options on
samlpconnections, following the Management API change that makes them available on SAML the same way they already are onoidcandokta.token_endpoint_auth_signing_algandtoken_endpoint_jwtca_aud_formatwere rejected byvalidate()for every strategy exceptoidcandokta, so asamlpconnection carrying them could not be deployed. They are now accepted onsamlptoo.id_token_signed_response_algsandid_token_session_expiry_supportedstayoidcandoktaonly. The validation error now names the strategies allowed for the offending options and reports every violated group at once. The top-levelcross_app_access_requesting_appand the other options (client_id,client_secret,discovery_url,oidc_metadata,token_endpoint_auth_method) already passed through, so they needed no handler change.The second change closes a data-loss path that this feature makes relevant. Export masks
options.client_secretas##CONNECTIONS_<STRATEGY>_SECRET##. When that placeholder is left unresolved on import it is stripped before the update, and because Auth0 replacesoptionsas a whole on update, the stored secret was cleared with no warning. The connections handler now substitutes the stored secret when the placeholder is unresolved and a connection with the same name and strategy already has one, in both the real import and the dry run, and logs a warning naming the mapping to define. An explicit empty ornullclient_secretstill clears it. This applies to any connection whose storedclient_secretthe API returns on list. The comment and warning instripUnresolvedPlaceholdersno longer claim that a dropped field keeps its stored value, since that only holds when the API merges updates.Not a breaking change: validation is only loosened, and the secret handling only changes the previously destructive case. Some values (
active: trueandprivate_key_jwt) are gated by an EA feature enabled on the tenant, and the API returns its own error when it is not. The docs now describe thesamlpoptions, the secret placeholder and this gating.Shape
A
samlpconnection could previously carry the requesting app and client credential fields, but not the signing algorithm or audience format.YAML, before (the two token endpoint fields below failed validation on
samlp):YAML, after:
Directory (JSON), before:
{ "name": "saml-xaa", "strategy": "samlp", "cross_app_access_requesting_app": { "active": true }, "options": { "client_id": "idp-client-id", "client_secret": "##CONNECTIONS_SAMLP_SECRET##", "token_endpoint_auth_method": "private_key_jwt" } }Directory (JSON), after:
{ "name": "saml-xaa", "strategy": "samlp", "cross_app_access_requesting_app": { "active": true }, "options": { "client_id": "idp-client-id", "client_secret": "##CONNECTIONS_SAMLP_SECRET##", "token_endpoint_auth_method": "private_key_jwt", "token_endpoint_auth_signing_alg": "RS256", "token_endpoint_jwtca_aud_format": "issuer" } }🔬 Testing
Unit tests
Added or updated in
test/tools/auth0/handlers/connections.tests.js:token_endpoint_auth_signing_algandtoken_endpoint_jwtca_aud_formatonsamlpalongside the other requesting app options (replaces the test that assertedsamlpwas rejected)id_token_signed_response_algsandid_token_session_expiry_supportedonsamlp, without flagging the token endpoint fieldsoidc,oktaandsamlpclient_secretwhen the exported placeholder is unresolved, in bothcalcChangesanddryRunChanges, forsamlpand for another strategyclient_secretin the update payload thatprocessChangeshands to the update callclient_secret, an explicit empty one, or an explicitnullrestoreMaskedClientSecretignores connections without options and connections with no stored matchManual verification
Against a live tenant with the EA feature for Cross App Access on SAML enabled, scoped to connections:
samlpconnection withcross_app_access_requesting_app.active: true,client_id,client_secret, adiscovery_url,private_key_jwt,RS256andissuer, in both YAML and directory format. The dry run previews a single create.oidc_metadatais populated from the discovery URL.client_secretis written as##CONNECTIONS_SAMLP_SECRET##. Import that export without a keyword mapping and confirm the stored secret is unchanged and a warning is logged. With a mapping, confirm the new value is applied. Settingclient_secretto""clears it.active: falseand confirm the role turns off. Omitcross_app_access_requesting_appand confirm it stays unchanged.active: trueandprivate_key_jwtreturn400 operation_not_supported, and thatclient_id,client_secret,client_secret_post, the signing algorithm and the audience format are accepted.client_secretfor each ofoidc,okta,waad,facebook,linkedinandgithub, export, and import the export with no keyword mapping. The stored secrets are unchanged, a warning is logged for each, and the dry run reports no changes.active: true, confirm the export no longer includescross_app_access_requesting_app, and that importing a config that still sendsactive: truereturns the same400.📝 Checklist