Skip to content

Updating UI for Okta config - #35204

Merged
getvictor merged 33 commits into
mainfrom
victor/34539-okta-ui
Nov 19, 2025
Merged

Updating UI for Okta config#35204
getvictor merged 33 commits into
mainfrom
victor/34539-okta-ui

Conversation

@getvictor

@getvictor getvictor commented Nov 5, 2025

Copy link
Copy Markdown
Member

Related issue: Resolves #34539

Figma: https://www.figma.com/design/OgQ8SyLK8Sw5thXtF1eiNP/-31909-Conditional-access-w--Okta

Requires backend PR #35526 to view Apple profile.

Checklist for submitter

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented (using placeholders for values in statements)

Testing

  • Added/updated automated tests
  • QA'd all new/changed functionality manually

Summary by CodeRabbit

  • New Features
    • Added Okta as a conditional access provider alongside Microsoft Entra
    • Users can now configure both identity providers simultaneously or use either independently
    • Updated configuration interface with new Okta-specific settings
    • Redesigned UI with separate provider cards for improved clarity

@codecov

codecov Bot commented Nov 5, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.80000% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.13%. Comparing base (c5e789a) to head (109d882).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ditionalAccessModal/OktaConditionalAccessModal.tsx 73.14% 29 Missing ⚠️
...Page/cards/ConditionalAccess/ConditionalAccess.tsx 81.90% 19 Missing ⚠️
...itionalAccessModal/EntraConditionalAccessModal.tsx 84.84% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #35204      +/-   ##
==========================================
- Coverage   66.23%   66.13%   -0.10%     
==========================================
  Files        2110     2104       -6     
  Lines      179360   177620    -1740     
  Branches     7486     7509      +23     
==========================================
- Hits       118797   117470    -1327     
+ Misses      49666    49406     -260     
+ Partials    10897    10744     -153     
Flag Coverage Δ
frontend 53.97% <78.80%> (+0.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@getvictor

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Nov 10, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Full review triggered.

@coderabbitai

coderabbitai Bot commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This PR adds Okta conditional access configuration support to the Fleet UI, complementing the existing Microsoft Entra integration. Changes include new Okta configuration fields in types and mocks, refactored ConditionalAccess component supporting dual-vendor UI, new modal components for Okta and Entra configuration flows, expanded test coverage, and a new API endpoint constant.

Changes

Cohort / File(s) Summary
Configuration & Types
frontend/__mocks__/configMock.ts, frontend/interfaces/config.ts, frontend/utilities/endpoints.ts
Added Okta-related fields (okta_idp_id, okta_assertion_consumer_service_url, okta_audience_uri, okta_certificate) to config mock and IConfig interface; added new endpoint constant CONDITIONAL_ACCESS_IDP_SIGNING_CERT.
Storybook Configuration
.storybook/main.ts
Added story source path for frontend/pages/admin/IntegrationsPage/**/*.stories.* to enable Storybook discovery.
Core Component
frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/ConditionalAccess.tsx
Replaced single-vendor (Entra-only) UI with dual-vendor conditional access component supporting both Microsoft Entra and Okta; introduced Phase state machine, per-provider disconnect logic, provider-aware banners, and integration with new modal components. Updated IDeleteConditionalAccessModal interface with provider-specific handling.
Modal Components
frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/EntraConditionalAccessModal/EntraConditionalAccessModal.tsx, frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/OktaConditionalAccessModal/OktaConditionalAccessModal.tsx
Added EntraConditionalAccessModal for tenant ID input and OAuth flow; added OktaConditionalAccessModal with form state management, file upload validation for PEM certificates, per-field validation, and config submission.
Modal Index Re-exports
frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/EntraConditionalAccessModal/index.ts, frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/OktaConditionalAccessModal/index.ts
Added index files re-exporting default components for cleaner imports.
Styles
frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/_styles.scss, frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/EntraConditionalAccessModal/_styles.scss
Added styles for page description spacing, card layout (flex column), and modal instructions/form field styling.
Stories & Tests
frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/ConditionalAccess.stories.tsx, frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/ConditionalAccess.tests.tsx
Expanded stories to cover NotConfigured, AwaitingOAuthCompletion, EntraConfigured, OktaConfigured, BothConfigured, and FreeTier scenarios with proper context mocking; expanded test suite to cover Okta and Entra modals, form submission, deletion flows, and premium tier validation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI as ConditionalAccess UI
    participant EntraModal as Entra Modal
    participant OktaModal as Okta Modal
    participant Backend as Fleet Backend
    participant OAuth as OAuth Provider

    User->>UI: Select provider to configure
    
    alt Microsoft Entra Flow
        User->>EntraModal: Open Entra modal
        User->>EntraModal: Enter tenant ID
        User->>EntraModal: Click Save
        EntraModal->>Backend: triggerMicrosoftConditionalAccess(tenantId)
        Backend-->>EntraModal: Return OAuth URL
        EntraModal->>OAuth: Open window to OAuth provider
        OAuth-->>User: Complete OAuth flow
        User->>EntraModal: Close modal
        EntraModal->>UI: onSuccess callback
        UI->>UI: Show "awaiting configuration" banner
    else Okta Flow
        User->>OktaModal: Open Okta modal
        User->>OktaModal: Fill IdP ID, ACS URL, Audience URI
        User->>OktaModal: Upload PEM certificate
        OktaModal->>OktaModal: Validate form & file
        User->>OktaModal: Click Save
        OktaModal->>Backend: configAPI.update(conditional_access config)
        Backend-->>OktaModal: Return updated config
        OktaModal->>UI: onSuccess with updated config
        UI->>UI: Show success/error banner
    end

    UI->>UI: Refresh provider cards display
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35–45 minutes

Areas requiring extra attention:

  • OktaConditionalAccessModal.tsx: File upload validation logic, PEM certificate handling, per-field form validation, and state synchronization with parent component config updates.
  • ConditionalAccess.tsx: State machine and Phase enum logic, per-provider deletion flows with different config update strategies (Entra full reload vs. Okta field clearing), and conditional rendering based on provider and configuration state.
  • Test expansion in ConditionalAccess.tests.tsx: Verify both Okta and Entra flows are properly mocked, modal interactions are tested, and delete confirmation wording matches expectations.
  • Modal callback signatures: Ensure EntraConditionalAccessModal and OktaConditionalAccessModal are called with correct parameters and callbacks are properly integrated into parent component state updates.

Possibly related PRs

  • Okta IdP factor #35143: Backend implementation of the IdP signing-cert endpoint (CONDITIONAL_ACCESS_IDP_SIGNING_CERT) and related service/handler that this frontend change consumes.
  • Okta conditional access configs #34566: Backend handling of Okta conditional_access config fields (okta_idp_id, okta_assertion_consumer_service_url, okta_audience_uri, okta_certificate) that this PR exposes in the UI layer.

Suggested reviewers

  • jacobshandling
  • ghernandez345
  • dantecatalfamo

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Updating UI for Okta config' clearly summarizes the main objective of the changeset, which focuses on implementing UI updates for Okta configuration across multiple frontend components and files.
Linked Issues check ✅ Passed The code changes comprehensively implement the Okta config UI as specified in issue #34539, adding Okta configuration modal components, validation, form fields, and integrating them into the ConditionalAccess card alongside Microsoft Entra support.
Out of Scope Changes check ✅ Passed All changes directly support Okta UI configuration: adding Okta modal components, updating config interfaces, extending tests, modifying stories, and updating styling are all within scope of implementing the Okta config UI feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description includes the related issue reference, completion of critical checklist items (changes file, input validation, testing), and links to design and backend dependencies.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch victor/34539-okta-ui

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 and usage tips.

@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: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0471b8c and aff0b80.

📒 Files selected for processing (13)
  • .storybook/main.ts (1 hunks)
  • frontend/__mocks__/configMock.ts (1 hunks)
  • frontend/interfaces/config.ts (1 hunks)
  • frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/ConditionalAccess.stories.tsx (2 hunks)
  • frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/ConditionalAccess.tests.tsx (6 hunks)
  • frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/ConditionalAccess.tsx (6 hunks)
  • frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/_styles.scss (1 hunks)
  • frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/EntraConditionalAccessModal/EntraConditionalAccessModal.tsx (1 hunks)
  • frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/EntraConditionalAccessModal/_styles.scss (1 hunks)
  • frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/EntraConditionalAccessModal/index.ts (1 hunks)
  • frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/OktaConditionalAccessModal/OktaConditionalAccessModal.tsx (1 hunks)
  • frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/OktaConditionalAccessModal/index.ts (1 hunks)
  • frontend/utilities/endpoints.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: getvictor
Repo: fleetdm/fleet PR: 34566
File: server/service/integration_core_test.go:7500-7511
Timestamp: 2025-10-21T16:04:18.069Z
Learning: Okta conditional access app config in Fleet is Premium-gated and supported both on-prem and in Fleet Cloud; the Cloud-only enforcement applies to the Microsoft compliance partner endpoints, not to the Okta settings.
📚 Learning: 2025-10-21T16:04:18.069Z
Learnt from: getvictor
Repo: fleetdm/fleet PR: 34566
File: server/service/integration_core_test.go:7500-7511
Timestamp: 2025-10-21T16:04:18.069Z
Learning: Okta conditional access app config in Fleet is Premium-gated and supported both on-prem and in Fleet Cloud; the Cloud-only enforcement applies to the Microsoft compliance partner endpoints, not to the Okta settings.

Applied to files:

  • frontend/utilities/endpoints.ts
  • frontend/interfaces/config.ts
🔇 Additional comments (8)
frontend/interfaces/config.ts (1)

158-167: LGTM! Clean interface extension for Okta support.

The new Okta fields are properly typed and follow the same pattern as the existing Microsoft Entra fields. The structure supports the dual-vendor conditional access UI introduced in this PR.

frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/EntraConditionalAccessModal/_styles.scss (1)

1-16: LGTM! Standard modal styling.

The styling uses appropriate design system variables and follows consistent SCSS patterns. The nested structure and spacing values are appropriate for the modal UI.

frontend/__mocks__/configMock.ts (1)

118-121: LGTM! Mock data aligns with interface.

The new Okta fields in the mock configuration correctly match the interface updates, with appropriate empty string defaults for unconfigured state.

frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/_styles.scss (1)

1-12: LGTM! Appropriate styling integration.

The import statement correctly integrates the Entra modal styles, and the new flex column layout with gap provides consistent spacing for the multi-provider card UI.

.storybook/main.ts (1)

49-49: LGTM! Story coverage extension.

Adding the IntegrationsPage story path appropriately extends Storybook coverage to include the new Conditional Access modals and related components.

frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/EntraConditionalAccessModal/index.ts (1)

1-1: LGTM! Standard export pattern.

The re-export follows conventional patterns for component index files, enabling clean imports of the EntraConditionalAccessModal component.

frontend/pages/admin/IntegrationsPage/cards/ConditionalAccess/components/OktaConditionalAccessModal/index.ts (1)

1-1: LGTM! Standard export pattern.

The re-export follows the same conventional pattern as the EntraConditionalAccessModal, enabling clean imports of the OktaConditionalAccessModal component.

frontend/utilities/endpoints.ts (1)

21-21: No changes needed—endpoint path is correct.

The frontend endpoint uses underscores (conditional_access/idp/signing_cert), which matches the backend route definition at server/service/handler.go:560 and the integration test at ee/server/integrationtest/condaccess/condaccess_test.go:424. The inconsistency with the Microsoft conditional access endpoint (which uses hyphens) is expected, as these are separate endpoints with different naming conventions in the backend.

Likely an incorrect or invalid review comment.

jacobshandling
jacobshandling previously approved these changes Nov 19, 2025

@jacobshandling jacobshandling 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.

Great work, lgtm

</p>
<p>
If you don&apos;t, end users will stay blocked even after deleting
Entra.

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.

@noahtalerman the above copy you just added to main needs updating in the context of this new Okta conditional access option.

Here's the current Figma that Victor implemented , please update that so we can implement it accordingly here, thank you
Screenshot 2025-11-18 at 4 12 24 PM

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.

(test failure is related to this)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Up to @rachaelshaw

The reason we updated the copy for Entra was because it wasn't true.

Is the current Okta copy correct? Does disconnecting Fleet from Okta unblock end users?

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.

I updated this to show your new copy for Entra and the current Figma for Okta

@getvictor getvictor Nov 19, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@noahtalerman
For Okta, the connection mainly happens in Okta's settings. IT admin would need to remove Fleet as a factor to unblock users. Conversely, just because Okta appears configured in the Fleet UI does not mean Okta will actually use Fleet as a factor for conditional access. Another way to unblock users is to remove policies from conditional access.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IT admin would need to remove Fleet as a factor to unblock users

Ok, then I think we want to update the copy. I opened a PR: #36133

Deleting Okta from Fleet won't unblock users.

Another way to unblock users is to remove policies from conditional access.

This requires a refetch before end users are unblocked right? That's why I think we want to go w/ instructions to, in Okta, remove Fleet as a factor.

FYI @rachaelshaw

@getvictor
getvictor merged commit 767c594 into main Nov 19, 2025
20 of 22 checks passed
@getvictor
getvictor deleted the victor/34539-okta-ui branch November 19, 2025 01:35
noahtalerman added a commit that referenced this pull request Nov 21, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Dec 10, 2025
2 tasks
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.

Okta config UI

3 participants