Repository navigation
feat(connections): support XAA requesting app options on samlp connections - #1535
Draft
harshithRai wants to merge 1 commit into
Draft
harshithRai wants to merge 1 commit into
harshithRai wants to merge 1 commit 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.66% +0.01%
==========================================
Files 193 193
Lines 9301 9310 +9
Branches 2061 2064 +3
==========================================
+ Hits 7687 7696 +9
Misses 816 816
Partials 798 798 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 already has one, in both the real import and the dry run. An explicit emptyclient_secretstill clears it. This applies to every strategy, not onlysamlp.Not a breaking change: validation is only loosened, and the secret handling only changes the previously destructive case. Tenant feature flags still gate some values on the API side (
active: true,private_key_jwt,discovery_urlandoidc_metadata), and the API returns its own error when they are off. The docs now describe this forsamlp.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 bothcalcChangesanddryRunChangesclient_secretor an explicit empty onerestoreMaskedClientSecretignores connections without options and connections with no stored matchManual verification
Against a live tenant with
token_vault_xaaandtoken_vault_xaa_samlenabled, 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. 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.Not covered:
discovery_urlwith the flags off (the API returned a discovery fetch error before it reached the flag check), and the secret handling onoidcandoktaconnections beyond the unit tests.📝 Checklist