Skip to content

feat: integrate third party and cross app access in sso provider edit - #472

Open
rax7389 wants to merge 7 commits into
feat/3p-cross-app-access-sectionfrom
feat/3p-sso-provider-edit
Open

feat: integrate third party and cross app access in sso provider edit#472
rax7389 wants to merge 7 commits into
feat/3p-cross-app-access-sectionfrom
feat/3p-sso-provider-edit

Conversation

@rax7389

@rax7389 rax7389 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Integrate SsoThirdPartyAccessSection and SsoCrossAppAccessSection components into the SSO Provider Edit screen.

Why

Users need to configure third-party access and cross-app access settings when editing existing SSO providers. Part 4 of the 3P Client Access feature (UIC-1380).

What

  • Integrate shared sections into SsoProviderDetails and SsoProviderTab components
  • Update useSsoProviderEdit hook to expose showThirdPartyAccess, showCrossAppAccess, isCrossAppAccessReadOnly
  • Update SSO provider mappers to handle use_for_third_party_client_access and cross_app_access_resource_app fields
  • Add mapper tests for new fields (10 new tests)

Packages

  • packages/core
  • packages/react
  • examples

References

Testing

  • This change adds unit test coverage
  • Tested for both SPA and RWA flows, all example apps working
  • All existing and new tests complete without errors

Checklist

  • Breaking change
  • Requires docs update
  • Backward compatible

Contributing

Summary by CodeRabbit

  • New Features
    • Added configuration options for using SSO providers with third-party client access and cross-application access.
    • Access settings are now shown or hidden based on available configuration.
    • Cross-application access can be marked read-only when required.
    • New settings are preserved when creating or updating SSO providers.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f64cf892-f558-4216-adf7-0bbc43c10a85

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/3p-sso-provider-edit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rax7389

rax7389 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/core/src/services/my-organization/idp-management/sso-provider/sso-provider-mappers.ts`:
- Around line 124-125: Update the SSO provider form and request Zod schemas to
validate use_for_third_party_client_access and cross_app_access_resource_app,
parse these fields before SsoProviderMappers.createToAPI and updateToAPI, and
wire both validated values through the create service as well as the existing
update flow.

In
`@packages/react/src/hooks/my-organization/__tests__/use-sso-provider-edit.test.ts`:
- Around line 21-23: Update the isCrossAppAccessReadOnly mock to return true
when cross-app access is hidden in both
packages/react/src/hooks/my-organization/__tests__/use-sso-provider-edit.test.ts:21-23
and
packages/react/src/hooks/my-organization/__tests__/use-sso-provider-table.test.ts:55-57;
keep showCrossAppAccess returning false and leave getCrossAppAccessDefaultValue
unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3fb921af-0471-4cf6-8857-fd914bca888b

📥 Commits

Reviewing files that changed from the base of the PR and between 58d1618 and 156b9e8.

📒 Files selected for processing (8)
  • packages/core/src/services/my-organization/idp-management/sso-provider/__tests__/sso-provider-mappers.test.ts
  • packages/core/src/services/my-organization/idp-management/sso-provider/sso-provider-mappers.ts
  • packages/react/src/components/auth0/my-organization/shared/idp-management/sso-provider-edit/sso-provider-details.tsx
  • packages/react/src/components/auth0/my-organization/shared/idp-management/sso-provider-edit/sso-provider-tab.tsx
  • packages/react/src/hooks/my-organization/__tests__/use-sso-provider-edit.test.ts
  • packages/react/src/hooks/my-organization/__tests__/use-sso-provider-table.test.ts
  • packages/react/src/hooks/my-organization/use-sso-provider-edit.ts
  • packages/react/src/types/my-organization/idp-management/sso-provider/sso-provider-edit-types.ts

Comment on lines +124 to +125
use_for_third_party_client_access,
cross_app_access_resource_app,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

file="packages/core/src/services/my-organization/idp-management/sso-provider/sso-provider-mappers.ts"

printf '%s\n' '--- mapper outline ---'
ast-grep outline "$file" 2>/dev/null || true

printf '%s\n' '--- mapper sections ---'
sed -n '1,230p' "$file"

printf '%s\n' '--- related schema/type references ---'
rg -n -C 3 \
  'use_for_third_party_client_access|cross_app_access_resource_app|SSOProvider|sso-provider|SsoProvider' \
  packages/core/src/schemas packages/core/src/services packages/core/src 2>/dev/null | head -n 500

Repository: auth0/auth0-ui-components

Length of output: 50381


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- create schema ---'
cat -n packages/core/src/schemas/my-organization/idp-management/sso-provider/sso-provider-create-schema.ts

printf '%s\n' '--- schema type definitions ---'
cat -n packages/core/src/schemas/my-organization/idp-management/sso-provider/sso-provider-create-schema-types.ts

printf '%s\n' '--- API and mapper type definitions ---'
cat -n packages/core/src/services/my-organization/idp-management/sso-provider/sso-provider-types.ts

printf '%s\n' '--- mapper call sites ---'
rg -n -C 5 'createToAPI|updateToAPI|CreateIdentityProvider|UpdateIdentityProvider' \
  packages/core/src packages/react/src | head -n 400

printf '%s\n' '--- schema parsing usage in this flow ---'
rg -n -C 4 'safeParse|parse\(|Resolver|zodResolver|sso-provider-create-schema|sso-provider-edit-schema' \
  packages/core/src packages/react/src | head -n 500

Repository: auth0/auth0-ui-components

Length of output: 50382


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- direct mapper call sites ---'
rg -n 'SsoProviderMappers\.(createToAPI|updateToAPI)' packages/core/src packages/react/src

printf '%s\n' '--- service implementations near mapper calls ---'
rg -l 'SsoProviderMappers\.(createToAPI|updateToAPI)' packages/core/src packages/react/src |
  while IFS= read -r f; do
    echo "### $f"
    rg -n -C 12 'SsoProviderMappers\.(createToAPI|updateToAPI)' "$f"
  done

printf '%s\n' '--- access-control schema declarations ---'
rg -n -C 8 \
  'use_for_third_party_client_access|cross_app_access_resource_app|CrossAppAccessResourceApp' \
  packages/core/src/schemas packages/react/src

printf '%s\n' '--- Zod parsing at API request boundaries ---'
rg -n -C 5 \
  '\.(parse|safeParse)\(|zodResolver|create.*Schema|Request.*Schema' \
  packages/core/src/services packages/core/src/schemas | head -n 500

Repository: auth0/auth0-ui-components

Length of output: 50382


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- create service and form data path ---'
sed -n '1,115p' packages/react/src/hooks/my-organization/shared/services/use-sso-provider-create-service.ts
rg -l 'use_for_third_party_client_access|cross_app_access_resource_app' packages/react/src packages/core/src |
  sort

printf '%s\n' '--- edit service and edit form path ---'
sed -n '1,225p' packages/react/src/hooks/my-organization/shared/services/use-sso-provider-edit-service.ts
rg -n -C 6 \
  'use_for_third_party_client_access|cross_app_access_resource_app' \
  packages/react/src/components packages/react/src/hooks packages/react/src/types 2>/dev/null | head -n 700

printf '%s\n' '--- all core schema parsing and API client calls in this feature ---'
rg -n -C 4 \
  'identityProviders\.(create|update|get|list)|safeParse|zodResolver|\.parse\(' \
  packages/core/src/services/my-organization/idp-management packages/react/src/hooks/my-organization \
  | head -n 700

Repository: auth0/auth0-ui-components

Length of output: 50381


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
from pathlib import Path
import re

mapper = Path("packages/core/src/services/my-organization/idp-management/sso-provider/sso-provider-mappers.ts").read_text()
create_service = Path("packages/react/src/hooks/my-organization/shared/services/use-sso-provider-create-service.ts").read_text()
schema = Path(
    "packages/core/src/schemas/my-organization/idp-management/sso-provider/sso-provider-create-schema.ts"
).read_text()

fields = ["use_for_third_party_client_access", "cross_app_access_resource_app"]

print("--- boundary verifier ---")
for field in fields:
    print(f"{field}: mapper top-level forwarding = {field in mapper}")
    print(f"{field}: create service explicit destructure = "
          f"{re.search(rf'\\b{re.escape(field)}\\b', create_service) is not None}")
    print(f"{field}: create schema declaration = "
          f"{re.search(rf'\\b{re.escape(field)}\\b', schema) is not None}")

print("--- validation verifier ---")
print("mapper imports zod =", bool(re.search(r"from ['\"]zod['\"]", mapper)))
print("mapper invokes parse/safeParse =", bool(re.search(r"\.(?:safeParse|parse)\s*\(", mapper)))
print("create service forwards access fields explicitly =",
      all(re.search(rf"^\s*{re.escape(field)},\s*$", create_service, re.M) for field in fields))

assert all(field in mapper for field in fields)
assert not re.search(r"from ['\"]zod['\"]", mapper)
assert not re.search(r"\.(?:safeParse|parse)\s*\(", mapper)
assert all(not re.search(rf"^\s*{re.escape(field)},\s*$", create_service, re.M) for field in fields)
assert all(field not in schema for field in fields)
print("Conclusion: the mapper forwards both fields when supplied, but the current create service and form schema do not supply/declare them; no Zod validation exists at this mapper boundary.")
PY

printf '%s\n' '--- exact access-field consumers outside mapper tests ---'
rg -n \
  'use_for_third_party_client_access|cross_app_access_resource_app' \
  packages/core/src packages/react/src \
  -g '!**/sso-provider-mappers.ts' \
  -g '!**/sso-provider-mappers.test.ts' \
  -g '!**/use-idp-config-service.ts' \
  -g '!**/use-idp-config-service.test.ts' || true

Repository: auth0/auth0-ui-components

Length of output: 410


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
from pathlib import Path
import re

mapper = Path("packages/core/src/services/my-organization/idp-management/sso-provider/sso-provider-mappers.ts").read_text()
create_service = Path("packages/react/src/hooks/my-organization/shared/services/use-sso-provider-create-service.ts").read_text()
schema = Path(
    "packages/core/src/schemas/my-organization/idp-management/sso-provider/sso-provider-create-schema.ts"
).read_text()

fields = ["use_for_third_party_client_access", "cross_app_access_resource_app"]

print("--- boundary verifier ---")
for field in fields:
    pattern = r"\b" + re.escape(field) + r"\b"
    print(f"{field}: mapper references = {bool(re.search(pattern, mapper))}")
    print(f"{field}: create service references = {bool(re.search(pattern, create_service))}")
    print(f"{field}: create schema references = {bool(re.search(pattern, schema))}")

print("--- validation verifier ---")
print("mapper imports zod =", bool(re.search(r"from ['\"]zod['\"]", mapper)))
print("mapper invokes parse/safeParse =", bool(re.search(r"\.(?:safeParse|parse)\s*\(", mapper)))
print(
    "create service forwards access fields explicitly =",
    all(
        re.search(r"^\s*" + re.escape(field) + r",\s*$", create_service, re.M)
        for field in fields
    ),
)

assert all(re.search(r"\b" + re.escape(field) + r"\b", mapper) for field in fields)
assert not re.search(r"from ['\"]zod['\"]", mapper)
assert not re.search(r"\.(?:safeParse|parse)\s*\(", mapper)
assert not all(
    re.search(r"^\s*" + re.escape(field) + r",\s*$", create_service, re.M)
    for field in fields
)
assert all(
    not re.search(r"\b" + re.escape(field) + r"\b", schema)
    for field in fields
)
print(
    "Conclusion: the mapper forwards both fields when supplied, but the current create "
    "service and form schema do not supply/declare them; no Zod validation exists at "
    "this mapper boundary."
)
PY

printf '%s\n' '--- exact access-field consumers outside mapper tests ---'
rg -n \
  'use_for_third_party_client_access|cross_app_access_resource_app' \
  packages/core/src packages/react/src \
  -g '!**/sso-provider-mappers.ts' \
  -g '!**/sso-provider-mappers.test.ts' \
  -g '!**/use-idp-config-service.ts' \
  -g '!**/use-idp-config-service.test.ts' || true

Repository: auth0/auth0-ui-components

Length of output: 964


Validate and wire the access-control fields.

Add both fields to the appropriate Zod form and request schemas. Parse them before SsoProviderMappers.createToAPI and updateToAPI. The mapper currently forwards unvalidated runtime values. The create service does not pass either field, so the create flow also needs wiring.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/core/src/services/my-organization/idp-management/sso-provider/sso-provider-mappers.ts`
around lines 124 - 125, Update the SSO provider form and request Zod schemas to
validate use_for_third_party_client_access and cross_app_access_resource_app,
parse these fields before SsoProviderMappers.createToAPI and updateToAPI, and
wire both validated values through the create service as well as the existing
update flow.

Sources: Coding guidelines, Learnings

Comment on lines +21 to +23
showCrossAppAccess: vi.fn(() => false),
isCrossAppAccessReadOnly: vi.fn(() => false),
getCrossAppAccessDefaultValue: vi.fn(() => undefined),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Match the absent-configuration read-only default.

Both mocks set showCrossAppAccess to false but set isCrossAppAccessReadOnly to false. The real useIdpConfig service returns true when no cross-app configuration exists. This mock can hide behavior that production uses.

  • packages/react/src/hooks/my-organization/__tests__/use-sso-provider-edit.test.ts#L21-L23: Set isCrossAppAccessReadOnly to vi.fn(() => true) when cross-app access is hidden.
  • packages/react/src/hooks/my-organization/__tests__/use-sso-provider-table.test.ts#L55-L57: Set isCrossAppAccessReadOnly to vi.fn(() => true) when cross-app access is hidden.
📍 Affects 2 files
  • packages/react/src/hooks/my-organization/__tests__/use-sso-provider-edit.test.ts#L21-L23 (this comment)
  • packages/react/src/hooks/my-organization/__tests__/use-sso-provider-table.test.ts#L55-L57
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/react/src/hooks/my-organization/__tests__/use-sso-provider-edit.test.ts`
around lines 21 - 23, Update the isCrossAppAccessReadOnly mock to return true
when cross-app access is hidden in both
packages/react/src/hooks/my-organization/__tests__/use-sso-provider-edit.test.ts:21-23
and
packages/react/src/hooks/my-organization/__tests__/use-sso-provider-table.test.ts:55-57;
keep showCrossAppAccess returning false and leave getCrossAppAccessDefaultValue
unchanged.

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.

1 participant