feat: add universal-portals setup command (Beta) - #1595
Draft
jacobovidal wants to merge 4 commits into
Draft
Conversation
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Derives manage and forms base URLs from the tenant domain without hardcoding auth0.com. Public tenants use 2-letter region codes (us, eu, ca, jp, uk) that appear only in the URL path, not the host. All other environments preserve the full domain suffix. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Adds `auth0 universal-portals setup` (alias: `auth0 up setup`) which
provisions all Auth0 resources required by a Universal Portals app:
- Auth0 My Account API + My Organization API (idempotent, 409 = skip)
- Regular Web App client with refresh_token policies, session_transfer,
and OIDC backchannel logout (raw HTTP due to SDK gaps)
- Three client grants with subject_type (raw HTTP due to SDK gap)
Domain is resolved from the default custom domain when available,
falling back to the tenant domain. Portal URL is opened in the browser
after setup completes.
Form and Portal provisioning are stubbed with TODO comments pending
payload from the UP team.
Note: make docs blocked by local vendor/modules.txt inconsistency;
docs will regenerate in CI.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Apply deep module principle and explicit dependency injection: - Orchestrator owns all display; business fns return (value, error) - ensurePortalResourceServer returns (alreadyExisted bool, err) instead of calling the renderer internally - ansi.Waiting moved to the orchestrator, not embedded in business fns - buildPortalGrants is now a pure function (no I/O, fully testable) - createPortalGrant is a single-grant fn; loop lives in the orchestrator - rawAPIPost helper eliminates duplicated HTTP error-decode pattern - Business fns take ctx + minimum interface (ResourceServerAPI, HTTPClientAPI, CustomDomainAPI) instead of *cli - portalManageClientURL is pure: explicit params, no struct access - portalResourceServers() extracted to make the RS list data-driven Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
jacobovidal
marked this pull request as draft
August 3, 2026 13:22
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.
Description:
🔧 Changes
Adds
auth0 universal-portals setup(alias:auth0 up setup) as a new top-level command that provisions all Auth0 resources required by a Universal Portals application in a single step:https://<tenant>/me/)https://<tenant>/my-org/)subject_typeper audience (My Account/My Org APIs →user, Management API →client)The portal domain is resolved automatically: uses the tenant's default custom domain if one is active, otherwise falls back to the tenant domain. Client ID is rendered as a clickable OSC8 hyperlink to the Management Dashboard. After setup, the portal URL is shown and optionally opened in the browser.
Raw HTTP is used for client and grant creation because
session_transfer,refresh_token.policies, andsubject_typeare absent from the vendored go-auth0 SDK.📚 References
🔬 Testing
Requires an active Auth0 CLI session (
auth0 login) on a beta-enabled tenant.Expected output:
Re-running the command should not fail — resource servers return (already exists).
Note: make docs is blocked by a local vendor/modules.txt inconsistency unrelated to this change; docs will regenerate in CI.
📝 Checklist