feat: add organization flags to auth0 apps create and update - #1690
Merged
Merged
Conversation
Add --organization-usage, --organization-require-behavior, and --organization-discovery-methods to auth0 apps create and update, so an application's organization behavior can be configured without dropping to the raw api command. The flags are additive and follow the existing optional-flag pattern: create sets each when provided, update only sends a field when its flag is set so unset flags never clobber existing values.
Add table-driven tests for the organization flag mapping on apps create and update, and validate client-side that --organization-discovery-methods is only used with --organization-require-behavior=pre_login_prompt so a misconfiguration returns an actionable error instead of a server 400. Gate the create org fields on flag presence to match update.
- Drop the client-side organization-require-behavior requires organization-usage=require check; the Management API accepts any usage, or none, alongside any require behavior - Keep the one real cross-field rule: organization-discovery-methods requires organization-require-behavior=pre_login_prompt - Strip empty organization-discovery-methods entries before sending - Run organization flag validation before the network read and interactive prompts - Render organization fields in apps show output - Update require-behavior help text and regenerate docs
ramya18101
approved these changes
Sep 29, 2026
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
Adds three flags to
auth0 apps createandauth0 apps updateso an application's organization behavior can be configured directly, without dropping to the rawauth0 apicommand:--organization-usage—deny,allow, orrequire--organization-require-behavior—no_prompt,pre_login_prompt, orpost_login_prompt--organization-discovery-methods— comma-separated list ofemail,organization_nameThe flags are additive and non-breaking, and follow the existing optional-flag pattern used by
--third-party-security-modeand--redirection-policy:create, each field is sent only when the flag is provided.update, a field is sent only when its flag is set, so unset flags never clobber existing values.Example:
🔬 Testing
Verified end-to-end against a live tenant: create sends all three fields;
updateof an unrelated field preserves org values; updating a single org field changes only that field; invalid values and the API'spre_login_promptdependency surface as clean400errors. Existing unit tests pass viamake test-unit, and docs were regenerated withmake docs.📝 Checklist