Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
674669e
feat(ui): display OIDC authorized redirect URI
NicolasLopes7 Jul 21, 2026
7b8a088
feat(ui): add OIDC claims configuration step
NicolasLopes7 Jul 21, 2026
069f908
feat(ui): add OIDC endpoint configuration step
NicolasLopes7 Jul 21, 2026
ae23318
feat(ui): save OIDC endpoints before credentials
NicolasLopes7 Jul 21, 2026
f8bbba8
feat(ui): add OIDC credentials configuration step
NicolasLopes7 Jul 22, 2026
b8a4067
fix(ui): align OIDC credentials configuration
NicolasLopes7 Jul 22, 2026
0f47940
fix(ui): use OIDC redirect URI from FAPI
NicolasLopes7 Jul 22, 2026
84e8714
fix(ui): show OIDC debug redirect URI
NicolasLopes7 Jul 22, 2026
0f9ef24
remove debug URI field
NicolasLopes7 Jul 23, 2026
eb3360e
refactor: move step into separate components rather than single-file
NicolasLopes7 Jul 23, 2026
67dc5cd
gymnastics
NicolasLopes7 Jul 23, 2026
af6b470
fix(ui): recognize custom OIDC provider keys
NicolasLopes7 Jul 23, 2026
5fc65c8
fix(ui): remove dead OIDC scopes control
NicolasLopes7 Jul 27, 2026
284c7ad
fix(ui): simplify OIDC setup flow
NicolasLopes7 Jul 28, 2026
b74a8c6
fix(ui): highlight OIDC token claims
NicolasLopes7 Jul 28, 2026
d25f3c0
fix(ui): separate OIDC token claims
NicolasLopes7 Jul 28, 2026
63d7c94
fix(ui): inline OIDC token claim guidance
NicolasLopes7 Jul 28, 2026
d546a93
fix(ui): show OIDC claims after redirect URI
NicolasLopes7 Jul 28, 2026
d39578c
fix(ui): address OIDC review feedback
NicolasLopes7 Jul 28, 2026
b41bc8d
chore(ui): merge OIDC self-serve configuration
NicolasLopes7 Jul 28, 2026
6ccc628
refactor(ui): simplify OIDC configuration
NicolasLopes7 Jul 28, 2026
87edea6
fix(ui): address OIDC configure feedback
NicolasLopes7 Jul 28, 2026
680de51
chore(ui): remove feedback changeset
NicolasLopes7 Jul 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/clerk-js/src/core/resources/EnterpriseConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ function oauthConfigFromJSON(data: EnterpriseOAuthConfigJSON): EnterpriseOAuthCo
name: data.name,
clientId: data.client_id,
providerKey: data.provider_key,
redirectUri: data.redirect_uri,
discoveryUrl: data.discovery_url,
authUrl: data.auth_url,
tokenUrl: data.token_url,
userInfoUrl: data.user_info_url,
logoPublicUrl: data.logo_public_url,
requiresPkce: data.requires_pkce,
createdAt: unixEpochToDate(data.created_at),
Expand All @@ -73,7 +77,11 @@ function oauthConfigToJSON(data: EnterpriseOAuthConfigResource): EnterpriseOAuth
name: data.name,
client_id: data.clientId,
provider_key: data.providerKey,
redirect_uri: data.redirectUri,
discovery_url: data.discoveryUrl,
auth_url: data.authUrl,
token_url: data.tokenUrl,
user_info_url: data.userInfoUrl,
logo_public_url: data.logoPublicUrl,
requires_pkce: data.requiresPkce,
created_at: data.createdAt?.getTime() ?? 0,
Expand Down
58 changes: 55 additions & 3 deletions packages/localizations/src/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,18 +240,70 @@ export const enUS: LocalizationResource = {
},
},
oidcCustom: {
claimsStep: {
headerSubtitle: 'Set the claims your identity provider includes in the ID token',
},
credentialsStep: {
headerSubtitle: 'Add your application credentials',
clientId: {
label: 'Client ID',
placeholder: 'Paste client ID here...',
},
clientSecret: {
label: 'Client secret',
placeholder: 'Paste client secret here...',
},
paragraph: 'In your identity provider’s OIDC application, retrieve these values.',
},
endpointsStep: {
headerSubtitle: 'Add your identity provider’s endpoints',
discoveryUrl: {
description:
'In your identity provider’s OIDC application, retrieve the discovery endpoint. Paste it below.',
label: 'Discovery endpoint',
placeholder: 'Paste URL here...',
},
manual: {
authUrl: {
label: 'Authorization URL',
placeholder: 'Paste URL here...',
},
description: 'In your identity provider’s OIDC application, retrieve these values.',
tokenUrl: {
label: 'Token URL',
placeholder: 'Paste URL here...',
},
userInfoUrl: {
label: 'User Info URL',
placeholder: 'Paste URL here...',
},
},
modes: {
ariaLabel: 'OIDC endpoint configuration method',
discoveryUrl: 'Add via discovery endpoint',
manual: 'Configure manually',
},
},
mainHeaderTitle: 'Configure your identity provider',
redirectUriStep: {
headerSubtitle: 'Create a new OIDC application in your identity provider’s dashboard',
paragraph:
'In your identity provider’s dashboard, create a new OIDC application that supports the authorization code grant type, and use the following redirect URI:',
claims: {
description: 'Ensure your ID token includes the following claims:',
table: {
columns: {
attribute: 'Clerk attribute',
claim: 'ID token claim',
},
rows: {
email: { attribute: 'Primary email' },
firstName: { attribute: 'First name' },
lastName: { attribute: 'Last name' },
subject: { attribute: 'External user ID' },
},
},
},
redirectUri: {
label: 'Authorized redirect URI',
},
},
},
samlCustom: {
Expand Down
10 changes: 10 additions & 0 deletions packages/shared/src/types/elementIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ export type FieldId =
| 'idpMetadata'
| 'idpMetadataUrl'
| 'idpSsoUrl'
| 'discoveryUrl'
| 'authUrl'
| 'tokenUrl'
| 'userInfoUrl'
| 'clientId'
| 'clientSecret'
| 'redirectUri'
| 'oidcClientId'
| 'oidcClientSecret'
| 'oidcRedirectUri'
| 'acsUrl'
| 'spEntityId'
| 'web3WalletName'
Expand Down
8 changes: 8 additions & 0 deletions packages/shared/src/types/enterpriseConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ export interface EnterpriseOAuthConfigJSON {
name: string;
provider_key?: string;
client_id: string;
redirect_uri?: string;
discovery_url?: string;
auth_url?: string;
token_url?: string;
user_info_url?: string;
logo_public_url?: string | null;
requires_pkce?: boolean;
created_at: number;
Expand All @@ -112,7 +116,11 @@ export interface EnterpriseOAuthConfigResource {
name: string;
clientId: string;
providerKey?: string;
redirectUri?: string;
discoveryUrl?: string;
authUrl?: string;
tokenUrl?: string;
userInfoUrl?: string;
logoPublicUrl?: string | null;
requiresPkce?: boolean;
createdAt: Date | null;
Expand Down
56 changes: 53 additions & 3 deletions packages/shared/src/types/localization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1529,15 +1529,65 @@ export type __internal_LocalizationResource = {
mainHeaderTitle: LocalizationValue;
redirectUriStep: {
headerSubtitle: LocalizationValue;
};
claimsStep: {
headerSubtitle: LocalizationValue;
paragraph: LocalizationValue;
claims: {
description: LocalizationValue;
table: {
columns: {
attribute: LocalizationValue;
claim: LocalizationValue;
};
rows: {
email: { attribute: LocalizationValue };
firstName: { attribute: LocalizationValue };
lastName: { attribute: LocalizationValue };
subject: { attribute: LocalizationValue };
};
};
};
redirectUri: {
label: LocalizationValue;
};
};
endpointsStep: {
headerSubtitle: LocalizationValue;
discoveryUrl: {
description: LocalizationValue;
label: LocalizationValue;
placeholder: LocalizationValue;
};
manual: {
authUrl: {
label: LocalizationValue;
placeholder: LocalizationValue;
};
description: LocalizationValue;
tokenUrl: {
label: LocalizationValue;
placeholder: LocalizationValue;
};
userInfoUrl: {
label: LocalizationValue;
placeholder: LocalizationValue;
};
};
modes: {
ariaLabel: LocalizationValue;
discoveryUrl: LocalizationValue;
manual: LocalizationValue;
};
};
credentialsStep: {
headerSubtitle: LocalizationValue;
clientId: {
label: LocalizationValue;
placeholder: LocalizationValue;
};
clientSecret: {
label: LocalizationValue;
placeholder: LocalizationValue;
};
paragraph: LocalizationValue;
};
};
unsupportedProvider: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
areAllOrganizationDomainsVerified,
connectionBackingEmail,
isEnterpriseConnectionConfigured,
isOidcProvider,
organizationEnterpriseConnection,
} from '../organizationEnterpriseConnection';

Expand Down Expand Up @@ -62,7 +61,7 @@ const fullyConfiguredSaml = makeSamlConnection({
const configuredOidc = makeOauthConfig({ clientId: 'client_abc' });

const makeOidcConnection = (overrides: Partial<EnterpriseConnectionResource> = {}): EnterpriseConnectionResource =>
makeConnection({ provider: 'oidc_custom', samlConnection: null, oauthConfig: configuredOidc, ...overrides });
makeConnection({ provider: 'oauth_custom_acme', samlConnection: null, oauthConfig: configuredOidc, ...overrides });

// Builds the entity with sensible defaults; each test overrides what it cares
// about.
Expand All @@ -75,18 +74,6 @@ const derive = (overrides: Partial<Parameters<typeof organizationEnterpriseConne
});

describe('organizationEnterpriseConnection', () => {
describe('isOidcProvider', () => {
it('recognizes OIDC provider keys with the oidc_ prefix', () => {
expect(isOidcProvider('oidc_custom')).toBe(true);
expect(isOidcProvider('oidc_clerk_dev')).toBe(true);
});

it('rejects malformed OIDC provider keys', () => {
expect(isOidcProvider('oidc')).toBe(false);
expect(isOidcProvider('oidcfoo')).toBe(false);
});
});

describe('hasConnection', () => {
it('undefined connection → false', () => {
expect(derive({ connection: undefined }).hasConnection).toBe(false);
Expand All @@ -106,8 +93,10 @@ describe('organizationEnterpriseConnection', () => {
it('connection → its provider', () => {
expect(derive({ connection: makeConnection({ provider: 'saml_custom' }) }).provider).toBe('saml_custom');
});
it('carries a derived OIDC key verbatim', () => {
expect(derive({ connection: makeConnection({ provider: 'oidc_clerk_dev' }) }).provider).toBe('oidc_clerk_dev');
it('carries a custom OIDC key verbatim', () => {
expect(derive({ connection: makeConnection({ provider: 'oauth_custom_clerk_dev' }) }).provider).toBe(
'oauth_custom_clerk_dev',
);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import type {

import type { EnterpriseConnectionProviderType, OidcProviderType } from '../types';

export const isOidcProvider = (provider: string): provider is OidcProviderType => provider.startsWith('oidc_');
export const isOidcProvider = (provider: string): provider is OidcProviderType =>
provider.startsWith('oidc_') || provider.startsWith('oauth_custom_');

/**
* The email whose domain backs the connection: the user's primary address if
Expand Down Expand Up @@ -56,7 +57,6 @@ export const isEnterpriseConnectionConfigured = (
if (!connection) {
return false;
}
// OIDC exposes only the client ID on the resource; the secret and manual endpoints are write-only.
if (isOidcProvider(connection.provider)) {
return Boolean(connection.oauthConfig?.clientId);
}
Expand Down
Loading
Loading