Skip to content

Commit c904fb4

Browse files
feat(ui): add experimental flag to gate the OIDC self-serve flow (#9198)
1 parent a009d91 commit c904fb4

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

.changeset/empty-ducks-tease.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@clerk/shared": patch
3+
"@clerk/ui": patch
4+
---
5+
6+
Add an experimental `oidcSelfServe` option to enable the self-serve OIDC configuration flow in `<ConfigureSSO />`.

packages/shared/src/types/clerk.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,6 +1481,10 @@ export type ClerkOptions = ClerkOptionsNavigation &
14811481
* directly with the provided Clerk instance. Used by React Native / Expo.
14821482
*/
14831483
runtimeEnvironment: 'headless';
1484+
/**
1485+
* Temporary flag that gates the self-serve OIDC flow in `<ConfigureSSO />`. Remove once the self-serve OIDC flow reaches GA.
1486+
*/
1487+
oidcSelfServe: boolean;
14841488
},
14851489
Record<string, any>
14861490
>;

packages/ui/src/components/ConfigureSSO/ConfigureSSOContext.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { EnterpriseConnectionResource, OrganizationDomainResource } from '@clerk/shared/types';
22
import React, { type PropsWithChildren } from 'react';
33

4+
import { useOptions } from '@/contexts';
5+
46
import type { OrganizationEnterpriseConnection } from './domain/organizationEnterpriseConnection';
57
import type {
68
EnterpriseConnectionMutations,
@@ -11,9 +13,9 @@ import type {
1113
export type { OrganizationDomainMutations };
1214

1315
/**
14-
* Shared state for the ConfigureSSO wizard, persisted across steps. Everything
15-
* is sourced from the umbrella `useOrganizationEnterpriseConnection` hook one
16-
* level up, so the context never observes a loading state and the steps read
16+
* Shared state for the ConfigureSSO wizard, persisted across steps. Connection
17+
* state is sourced from the umbrella `useOrganizationEnterpriseConnection` hook
18+
* one level up, so the context never observes a loading state and the steps read
1719
* display gates / mutations from a single place instead of re-deriving.
1820
*/
1921
export interface ConfigureSSOData {
@@ -26,6 +28,8 @@ export interface ConfigureSSOData {
2628
testRuns: TestRunsView;
2729
organizationDomains: OrganizationDomainResource[] | undefined;
2830
onExit?: () => void;
31+
/** Temporary gate for the self-serve OIDC flow; remove at OIDC GA. */
32+
isOIDCFlowEnabled: boolean;
2933
}
3034

3135
interface ConfigureSSOProviderProps {
@@ -53,6 +57,8 @@ export const ConfigureSSOProvider = ({
5357
onExit,
5458
children,
5559
}: PropsWithChildren<ConfigureSSOProviderProps>): JSX.Element => {
60+
const isOIDCFlowEnabled = useOptions().experimental?.oidcSelfServe ?? false;
61+
5662
const value = React.useMemo<ConfigureSSOData>(
5763
() => ({
5864
contentRef,
@@ -63,6 +69,7 @@ export const ConfigureSSOProvider = ({
6369
enterpriseConnectionMutations,
6470
organizationDomainMutations,
6571
onExit,
72+
isOIDCFlowEnabled,
6673
}),
6774
[
6875
contentRef,
@@ -73,6 +80,7 @@ export const ConfigureSSOProvider = ({
7380
organizationDomains,
7481
enterpriseConnection,
7582
onExit,
83+
isOIDCFlowEnabled,
7684
],
7785
);
7886

0 commit comments

Comments
 (0)