Skip to content

Support third party app security params#1522

Open
bkiran6398 wants to merge 9 commits into
mainfrom
DXCDT-1726/3p_apps
Open

Support third party app security params#1522
bkiran6398 wants to merge 9 commits into
mainfrom
DXCDT-1726/3p_apps

Conversation

@bkiran6398
Copy link
Copy Markdown
Contributor

@bkiran6398 bkiran6398 commented May 18, 2026

🔧 Changes

Adds CLI support for Auth0's Third-Party Client security improvements.

New flags on apps create:

  • --is-first-party (-f): Whether the application is a first-party client (true) or third-party client (false). Default: true
  • --third-party-security-mode (-s): Set security mode to strict or permissive
  • --redirection-policy (-y): Set to allow_always or open_redirect_protection

New flags on apps update:

  • --is-first-party (-f): Update whether the application is first-party or third-party
  • --third-party-security-mode (-s): Update the security mode
  • --redirection-policy (-y): Update the redirection policy

Display updates:

  • apps show and apps list now display IS FIRST PARTY, THIRD PARTY SECURITY MODE and REDIRECTION POLICY fields when set

Terraform fetcher fix:

  • Handles default_for client grants correctly during auth0 tf generate. Grants with default_for (which lack a client_id) now produce a meaningful resource name (default_for_third_party_clients_<audience>) instead of a broken _<audience> name.

Behavioral notes:

  • Default grant types are not applied for third-party apps (the API manages defaults)
  • Logout URL prompts are suppressed for third-party apps (not applicable)
  • Update uses IsSet() guards so these fields are only sent when explicitly provided

📚 References

🔬 Testing

  • Unit test added: TestClientGrantResourceFetcher_FetchData — verifies default_for grants produce correct resource names
  • Integration test added: test case 051 creates a regular app with --third-party-security-mode strict --redirection-policy open_redirect_protection and validates JSON output

Manual testing:

  • Verified CRUD operation on 3rd party apps using new flag values
  • Verified terraform generation for client grants with default_for value

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@bkiran6398 bkiran6398 marked this pull request as ready for review May 18, 2026 12:50
@bkiran6398 bkiran6398 requested a review from a team as a code owner May 18, 2026 12:50
Comment thread internal/cli/apps.go Outdated
Comment thread internal/cli/terraform_fetcher.go
Comment thread test/integration/apps-test-cases.yaml Outdated
… policy

- Introduced new flags for third-party applications:
  - `third-party-security-mode` to specify 'strict' or 'permissive'.
  - `redirection-policy` to control Auth0's behavior on authentication errors.

- Updated `createAppCmd` and `updateAppCmd` functions to handle new inputs.
- Enhanced `applicationView` to display third-party security mode and redirection policy.
- Ensured backward compatibility by integrating new features without affecting existing functionality.
…pport

- Updated the FetchData method in clientGrantResourceFetcher to handle
  grants marked as default_for, allowing for more accurate resource naming.
- Introduced a new test case to validate the handling of default_for grants
  in TestClientGrantResourceFetcher_FetchData, ensuring expected behavior
  when fetching client grants with different audiences.
…flags

- Added examples for `auth0 apps create` and `auth0 apps update` commands
  to demonstrate the usage of `--third-party-security-mode` and
  `--redirection-policy` flags.
- Updated documentation to reflect the new security features for
  third-party applications, enhancing clarity for users.
…ecurity mode

- Added a new test case to validate the creation of a regular app
  with third-party security mode set to strict and redirection policy
  set to open_redirect_protection.
- The test ensures that the app is created successfully and outputs
  the expected JSON response.
- Introduced a new flag `--is-first-party` to differentiate between first-party and third-party applications.
- Updated the command examples in `auth0_apps_create.md` and `auth0_apps_update.md` to reflect the new flag usage.
- Modified the `createAppCmd` and `updateAppCmd` functions in `apps.go` to handle the new flag.
- Enhanced the `applicationView` struct in `display/apps.go` to include the `IsFirstParty` field for display purposes.
- Added integration tests for creating, showing, updating, and deleting a third-party app.
- Created a new script `get-3p-app-id.sh` to handle the app ID retrieval for testing.
- Updated existing test cases to reflect the new structure and ensure proper validation of third-party app properties.
@bkiran6398 bkiran6398 force-pushed the DXCDT-1726/3p_apps branch from a44b7bb to 94b8efd Compare May 20, 2026 13:19
@ramya18101
Copy link
Copy Markdown
Contributor

ramya18101 commented May 20, 2026

Please add a friendly helping warning log, if any users try to just set only third-party related fields without manually setting is-first-party to false..

Let the users find a good help log on those scenario's as they are inter-dependent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants