Skip to content

Commit 3dac245

Browse files
authored
chore(clerk-js,shared,ui): Remove deprecated saml strategy (#7326)
1 parent 4da7668 commit 3dac245

File tree

19 files changed

+34
-113
lines changed

19 files changed

+34
-113
lines changed

.changeset/salty-maps-fry.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@clerk/clerk-js': major
3+
'@clerk/shared': major
4+
'@clerk/ui': major
5+
---
6+
7+
Remove deprecated `saml` strategy in favor of `enterprise_sso`

packages/clerk-js/src/core/resources/SignIn.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import type {
3232
ResetPasswordEmailCodeFactorConfig,
3333
ResetPasswordParams,
3434
ResetPasswordPhoneCodeFactorConfig,
35-
SamlConfig,
3635
SignInCreateParams,
3736
SignInFirstFactor,
3837
SignInFutureBackupCodeVerifyParams,
@@ -211,12 +210,6 @@ export class SignIn extends BaseResource implements SignInResource {
211210
case 'reset_password_email_code':
212211
config = { emailAddressId: params.emailAddressId } as ResetPasswordEmailCodeFactorConfig;
213212
break;
214-
case 'saml':
215-
config = {
216-
redirectUrl: params.redirectUrl,
217-
actionCompleteRedirectUrl: params.actionCompleteRedirectUrl,
218-
} as SamlConfig;
219-
break;
220213
case 'enterprise_sso':
221214
config = {
222215
redirectUrl: params.redirectUrl,
@@ -336,7 +329,7 @@ export class SignIn extends BaseResource implements SignInResource {
336329
});
337330
}
338331

339-
if (strategy === 'saml' || strategy === 'enterprise_sso') {
332+
if (strategy === 'enterprise_sso') {
340333
await this.prepareFirstFactor({
341334
strategy,
342335
redirectUrl,

packages/shared/src/internal/clerk-js/__tests__/completeSignUpFlow.test.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -85,34 +85,6 @@ describe('completeSignUpFlow', () => {
8585
expect(mockNavigate).not.toHaveBeenCalled();
8686
});
8787

88-
it('initiates a SAML flow if saml is listed as a missing field', async () => {
89-
const redirectUrl = 'https://www.in.gr/acs';
90-
const redirectUrlComplete = 'https://www.in.gr/tada';
91-
92-
const mockSignUp = {
93-
status: 'missing_requirements',
94-
missingFields: ['saml'],
95-
authenticateWithRedirect: mockAuthenticateWithRedirect,
96-
} as unknown as SignUpResource;
97-
98-
await completeSignUpFlow({
99-
signUp: mockSignUp,
100-
handleComplete: mockHandleComplete,
101-
navigate: mockNavigate,
102-
redirectUrl: 'https://www.in.gr/acs',
103-
redirectUrlComplete: 'https://www.in.gr/tada',
104-
});
105-
106-
expect(mockHandleComplete).not.toHaveBeenCalled();
107-
expect(mockNavigate).not.toHaveBeenCalled();
108-
expect(mockAuthenticateWithRedirect).toHaveBeenCalledWith({
109-
strategy: 'enterprise_sso',
110-
redirectUrl,
111-
redirectUrlComplete,
112-
continueSignUp: true,
113-
});
114-
});
115-
11688
it('initiates a Enterprise SSO flow if enterprise_sso is listed as a missing field', async () => {
11789
const redirectUrl = 'https://www.in.gr/acs';
11890
const redirectUrlComplete = 'https://www.in.gr/tada';

packages/shared/src/internal/clerk-js/completeSignUpFlow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const completeSignUpFlow = ({
2727
if (signUp.status === 'complete') {
2828
return handleComplete && handleComplete();
2929
} else if (signUp.status === 'missing_requirements') {
30-
if (signUp.missingFields.some(mf => mf === 'saml' || mf === 'enterprise_sso')) {
30+
if (signUp.missingFields.some(mf => mf === 'enterprise_sso')) {
3131
return signUp.authenticateWithRedirect({
3232
strategy: 'enterprise_sso',
3333
redirectUrl,

packages/shared/src/types/factors.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import type {
1111
PhoneCodeStrategy,
1212
ResetPasswordEmailCodeStrategy,
1313
ResetPasswordPhoneCodeStrategy,
14-
SamlStrategy,
1514
TOTPStrategy,
1615
Web3Strategy,
1716
} from './strategies';
@@ -57,10 +56,6 @@ export type OauthFactor = {
5756
strategy: OAuthStrategy;
5857
};
5958

60-
export type SamlFactor = {
61-
strategy: SamlStrategy;
62-
};
63-
6459
export type EnterpriseSSOFactor = {
6560
strategy: EnterpriseSSOStrategy;
6661
/**
@@ -115,11 +110,6 @@ export type OAuthConfig = OauthFactor & {
115110
oidcLoginHint?: string;
116111
};
117112

118-
export type SamlConfig = SamlFactor & {
119-
redirectUrl: string;
120-
actionCompleteRedirectUrl: string;
121-
};
122-
123113
export type EnterpriseSSOConfig = EnterpriseSSOFactor & {
124114
redirectUrl: string;
125115
actionCompleteRedirectUrl: string;

packages/shared/src/types/redirects.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { EnterpriseSSOStrategy, OAuthStrategy, SamlStrategy } from './strategies';
1+
import type { EnterpriseSSOStrategy, OAuthStrategy } from './strategies';
22

33
export type AfterSignOutUrl = {
44
/**
@@ -50,9 +50,9 @@ export type AuthenticateWithRedirectParams = {
5050

5151
/**
5252
* One of the supported OAuth providers you can use to authenticate with, eg 'oauth_google'.
53-
* Alternatively `saml` or `enterprise_sso`, to authenticate with Enterprise SSO.
53+
* Alternatively `enterprise_sso`, to authenticate with Enterprise SSO.
5454
*/
55-
strategy: OAuthStrategy | SamlStrategy | EnterpriseSSOStrategy;
55+
strategy: OAuthStrategy | EnterpriseSSOStrategy;
5656

5757
/**
5858
* Identifier to use for targeting a Enterprise Connection at sign-in

packages/shared/src/types/signInCommon.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import type {
2626
ResetPasswordPhoneCodeAttempt,
2727
ResetPasswordPhoneCodeFactor,
2828
ResetPasswordPhoneCodeFactorConfig,
29-
SamlConfig,
30-
SamlFactor,
3129
TOTPAttempt,
3230
TOTPFactor,
3331
Web3Attempt,
@@ -53,7 +51,6 @@ import type {
5351
PhoneCodeStrategy,
5452
ResetPasswordEmailCodeStrategy,
5553
ResetPasswordPhoneCodeStrategy,
56-
SamlStrategy,
5754
TicketStrategy,
5855
TOTPStrategy,
5956
Web3Strategy,
@@ -83,7 +80,6 @@ export type SignInFirstFactor =
8380
| ResetPasswordEmailCodeFactor
8481
| Web3SignatureFactor
8582
| OauthFactor
86-
| SamlFactor
8783
| EnterpriseSSOFactor;
8884

8985
export type SignInSecondFactor = PhoneCodeFactor | TOTPFactor | BackupCodeFactor | EmailCodeFactor | EmailLinkFactor;
@@ -106,7 +102,6 @@ export type PrepareFirstFactorParams =
106102
| ResetPasswordPhoneCodeFactorConfig
107103
| ResetPasswordEmailCodeFactorConfig
108104
| OAuthConfig
109-
| SamlConfig
110105
| EnterpriseSSOConfig;
111106

112107
export type AttemptFirstFactorParams =
@@ -124,7 +119,7 @@ export type AttemptSecondFactorParams = PhoneCodeAttempt | TOTPAttempt | BackupC
124119

125120
export type SignInCreateParams = (
126121
| {
127-
strategy: OAuthStrategy | SamlStrategy | EnterpriseSSOStrategy;
122+
strategy: OAuthStrategy | EnterpriseSSOStrategy;
128123
redirectUrl: string;
129124
actionCompleteRedirectUrl?: string;
130125
identifier?: string;
@@ -195,5 +190,4 @@ export type SignInStrategy =
195190
| TOTPStrategy
196191
| BackupCodeStrategy
197192
| OAuthStrategy
198-
| SamlStrategy
199193
| EnterpriseSSOStrategy;

packages/shared/src/types/signInFuture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface SignInFutureCreateParams {
1515
* The first factor verification strategy to use in the sign-in flow. Depends on the `identifier` value. Each
1616
* authentication identifier supports different verification strategies.
1717
*/
18-
strategy?: OAuthStrategy | 'saml' | 'enterprise_sso' | PasskeyStrategy;
18+
strategy?: OAuthStrategy | 'enterprise_sso' | PasskeyStrategy;
1919
/**
2020
* The full URL or path that the OAuth provider should redirect to after successful authorization on their part.
2121
*/

packages/shared/src/types/signUpCommon.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import type {
1616
GoogleOneTapStrategy,
1717
OAuthStrategy,
1818
PhoneCodeStrategy,
19-
SamlStrategy,
2019
TicketStrategy,
2120
Web3Strategy,
2221
} from './strategies';
@@ -50,7 +49,7 @@ export type PrepareVerificationParams =
5049
oidcLoginHint?: string;
5150
}
5251
| {
53-
strategy: SamlStrategy | EnterpriseSSOStrategy;
52+
strategy: EnterpriseSSOStrategy;
5453
redirectUrl?: string;
5554
actionCompleteRedirectUrl?: string;
5655
};
@@ -76,7 +75,7 @@ export type SignUpVerifiableField =
7675
| Web3WalletIdentifier;
7776

7877
// TODO: Does it make sense that the identification *field* holds a *strategy*?
79-
export type SignUpIdentificationField = SignUpVerifiableField | OAuthStrategy | SamlStrategy | EnterpriseSSOStrategy;
78+
export type SignUpIdentificationField = SignUpVerifiableField | OAuthStrategy | EnterpriseSSOStrategy;
8079

8180
// TODO: Replace with discriminated union type
8281
export type SignUpCreateParams = Partial<
@@ -86,7 +85,6 @@ export type SignUpCreateParams = Partial<
8685
externalAccountActionCompleteRedirectUrl: string;
8786
strategy:
8887
| OAuthStrategy
89-
| SamlStrategy
9088
| EnterpriseSSOStrategy
9189
| TicketStrategy
9290
| GoogleOneTapStrategy

packages/shared/src/types/strategies.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,3 @@ export type EnterpriseSSOStrategy = 'enterprise_sso';
1818

1919
export type OAuthStrategy = `oauth_${OAuthProvider}` | CustomOAuthStrategy;
2020
export type Web3Strategy = `web3_${Web3Provider}_signature`;
21-
22-
/**
23-
* @deprecated Use `EnterpriseSSOStrategy` instead.
24-
*/
25-
export type SamlStrategy = 'saml';

0 commit comments

Comments
 (0)