File tree Expand file tree Collapse file tree 6 files changed +74
-2
lines changed
ui/components/UserVerification Expand file tree Collapse file tree 6 files changed +74
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import type {
66 ActClaim ,
77 CheckAuthorization ,
88 EmailCodeConfig ,
9+ EnterpriseSSOConfig ,
910 GetToken ,
1011 GetTokenOptions ,
1112 PhoneCodeConfig ,
@@ -179,6 +180,12 @@ export class Session extends BaseResource implements SessionResource {
179180 case 'passkey' :
180181 config = { } ;
181182 break ;
183+ case 'enterprise_sso' :
184+ config = {
185+ emailAddressId : factor . emailAddressId ,
186+ enterpriseConnectionId : factor . enterpriseConnectionId ,
187+ } as EnterpriseSSOConfig ;
188+ break ;
182189 default :
183190 clerkInvalidStrategy ( 'Session.prepareFirstFactorVerification' , ( factor as any ) . strategy ) ;
184191 }
Original file line number Diff line number Diff line change 1+ import type { EnterpriseSSOFactor , SessionVerificationFirstFactor } from '@clerk/types' ;
2+
3+ import { Card , Card } from '@/ui/elements/Card' ;
4+ import { Header } from '@/ui/elements/Header' ;
5+
6+ import { localizationKeys } from '../../customizables' ;
7+
8+ type UVFactorOneEnterpriseSSOCardProps = {
9+ currentFactor : EnterpriseSSOFactor ;
10+ availableFactors : SessionVerificationFirstFactor [ ] | null ;
11+ } ;
12+
13+ export const UVFactorOneEnterpriseSSOCard = ( _props : UVFactorOneEnterpriseSSOCardProps ) => {
14+ return (
15+ < Card . Root >
16+ < Card . Content >
17+ < Header . Root showLogo >
18+ { /* TODO - Display headers depending on whether there's a single or multiple connections */ }
19+ < Header . Title localizationKey = { localizationKeys ( 'reverification.enterprise_sso.title' ) } />
20+ < Header . Subtitle localizationKey = { localizationKeys ( 'reverification.enterprise_sso.subtitle' ) } />
21+ </ Header . Root >
22+ < Card . Alert > { card . error } </ Card . Alert >
23+ { /* TODO -> Display option to choose enterprise SSO */ }
24+ </ Card . Content >
25+
26+ < Card . Footer />
27+ </ Card . Root >
28+ ) ;
29+ } ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { UserVerificationFactorOnePasswordCard } from './UserVerificationFactorO
1515import { useUserVerificationSession , withUserVerificationSessionGuard } from './useUserVerificationSession' ;
1616import { sortByPrimaryFactor } from './utils' ;
1717import { UVFactorOneEmailCodeCard } from './UVFactorOneEmailCodeCard' ;
18+ import { UVFactorOneEnterpriseSSOCard } from './UVFactorOneEnterpriseSSOCard' ;
1819import { UVFactorOnePasskeysCard } from './UVFactorOnePasskeysCard' ;
1920import { UVFactorOnePhoneCodeCard } from './UVFactorOnePhoneCodeCard' ;
2021
@@ -37,6 +38,7 @@ const SUPPORTED_STRATEGIES: SessionVerificationFirstFactor['strategy'][] = [
3738 'email_code' ,
3839 'phone_code' ,
3940 'passkey' ,
41+ 'enterprise_sso' ,
4042] as const ;
4143
4244export function UserVerificationFactorOneInternal ( ) : JSX . Element | null {
@@ -155,6 +157,13 @@ export function UserVerificationFactorOneInternal(): JSX.Element | null {
155157 ) ;
156158 case 'passkey' :
157159 return < UVFactorOnePasskeysCard onShowAlternativeMethodsClicked = { toggleAllStrategies } /> ;
160+ case 'enterprise_sso' :
161+ return (
162+ < UVFactorOneEnterpriseSSOCard
163+ currentFactor = { currentFactor }
164+ availableFactors = { availableFactors }
165+ />
166+ ) ;
158167 default :
159168 return < LoadingCard /> ;
160169 }
Original file line number Diff line number Diff line change @@ -63,6 +63,14 @@ export type SamlFactor = {
6363
6464export type EnterpriseSSOFactor = {
6565 strategy : EnterpriseSSOStrategy ;
66+ /**
67+ * @experimental
68+ */
69+ enterpriseConnectionId ?: string ;
70+ /**
71+ * @experimental
72+ */
73+ enterpriseConnectionName ?: string ;
6674} ;
6775
6876export type TOTPFactor = {
@@ -116,6 +124,14 @@ export type EnterpriseSSOConfig = EnterpriseSSOFactor & {
116124 redirectUrl : string ;
117125 actionCompleteRedirectUrl : string ;
118126 oidcPrompt ?: string ;
127+ /**
128+ * @experimental
129+ */
130+ emailAddressId ?: string ;
131+ /**
132+ * @experimental
133+ */
134+ enterpriseConnectionId ?: string ;
119135} ;
120136
121137export type PhoneCodeSecondFactorConfig = {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import type {
22 BackupCodeAttempt ,
33 EmailCodeAttempt ,
44 EmailCodeConfig ,
5+ EnterpriseSSOConfig ,
56 PasskeyAttempt ,
67 PassKeyConfig ,
78 PasswordAttempt ,
@@ -351,7 +352,11 @@ export type SessionVerifyCreateParams = {
351352 level : SessionVerificationLevel ;
352353} ;
353354
354- export type SessionVerifyPrepareFirstFactorParams = EmailCodeConfig | PhoneCodeConfig | PassKeyConfig ;
355+ export type SessionVerifyPrepareFirstFactorParams =
356+ | EmailCodeConfig
357+ | PhoneCodeConfig
358+ | PassKeyConfig
359+ | EnterpriseSSOConfig ;
355360export type SessionVerifyAttemptFirstFactorParams =
356361 | EmailCodeAttempt
357362 | PhoneCodeAttempt
Original file line number Diff line number Diff line change 11import type {
22 BackupCodeFactor ,
33 EmailCodeFactor ,
4+ EnterpriseSSOFactor ,
45 PasskeyFactor ,
56 PasswordFactor ,
67 PhoneCodeFactor ,
@@ -49,5 +50,10 @@ export type ReverificationConfig =
4950export type SessionVerificationLevel = 'first_factor' | 'second_factor' | 'multi_factor' ;
5051export type SessionVerificationAfterMinutes = number ;
5152
52- export type SessionVerificationFirstFactor = EmailCodeFactor | PhoneCodeFactor | PasswordFactor | PasskeyFactor ;
53+ export type SessionVerificationFirstFactor =
54+ | EmailCodeFactor
55+ | PhoneCodeFactor
56+ | PasswordFactor
57+ | PasskeyFactor
58+ | EnterpriseSSOFactor ;
5359export type SessionVerificationSecondFactor = PhoneCodeFactor | TOTPFactor | BackupCodeFactor ;
You can’t perform that action at this time.
0 commit comments