@frontegg/redux-store 4.42.1 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/LoginState/saga.d.ts +14 -4
- package/auth/SSOState/index.d.ts +93 -3
- package/auth/SSOState/interfaces.d.ts +56 -2
- package/auth/SSOState/saga.v2.d.ts +1 -0
- package/auth/index.d.ts +63 -2
- package/auth/index.js +285 -16
- package/auth/reducer.d.ts +63 -2
- package/helpers.d.ts +1 -1
- package/index.d.ts +3 -1
- package/index.js +1 -1
- package/node/auth/index.js +284 -15
- package/node/index.js +6 -0
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ export declare function loadSSOPublicConfigurationFunction(): Generator<import("
|
|
|
19
19
|
isActive: any;
|
|
20
20
|
}>;
|
|
21
21
|
export declare const isMfaRequired: (user: ILoginResponse) => boolean;
|
|
22
|
-
export declare function getMfaRequiredState(user: any): Generator<CallEffect<IAllowedToRememberMfaDevice>, {
|
|
22
|
+
export declare function getMfaRequiredState(user: any): Generator<import("redux-saga/effects").SelectEffect | CallEffect<IAllowedToRememberMfaDevice>, {
|
|
23
23
|
loginState: {
|
|
24
24
|
mfaToken: any;
|
|
25
25
|
mfaRequired: any;
|
|
@@ -30,10 +30,15 @@ export declare function getMfaRequiredState(user: any): Generator<CallEffect<IAl
|
|
|
30
30
|
tenants: never[];
|
|
31
31
|
allowRememberMfaDevice: any;
|
|
32
32
|
mfaDeviceExpiration: any;
|
|
33
|
+
ssoRedirectUrl?: string | undefined;
|
|
34
|
+
email?: string | undefined;
|
|
35
|
+
inviteTokenTenantName?: string | undefined;
|
|
36
|
+
inviteTokenError?: string | undefined;
|
|
37
|
+
isNewUser?: boolean | undefined;
|
|
33
38
|
};
|
|
34
39
|
user: undefined;
|
|
35
40
|
isAuthenticated: boolean;
|
|
36
|
-
}, {
|
|
41
|
+
}, AuthState & {
|
|
37
42
|
isAllowedToRemember: any;
|
|
38
43
|
mfaDeviceExpiration: any;
|
|
39
44
|
}>;
|
|
@@ -43,7 +48,7 @@ export declare function refreshToken(): Generator<import("redux-saga/effects").S
|
|
|
43
48
|
}> | import("redux-saga/effects").PutEffect<{
|
|
44
49
|
payload: Partial<AuthState>;
|
|
45
50
|
type: string;
|
|
46
|
-
}> | Generator<CallEffect<IAllowedToRememberMfaDevice>, {
|
|
51
|
+
}> | Generator<import("redux-saga/effects").SelectEffect | CallEffect<IAllowedToRememberMfaDevice>, {
|
|
47
52
|
loginState: {
|
|
48
53
|
mfaToken: any;
|
|
49
54
|
mfaRequired: any;
|
|
@@ -54,10 +59,15 @@ export declare function refreshToken(): Generator<import("redux-saga/effects").S
|
|
|
54
59
|
tenants: never[];
|
|
55
60
|
allowRememberMfaDevice: any;
|
|
56
61
|
mfaDeviceExpiration: any;
|
|
62
|
+
ssoRedirectUrl?: string | undefined;
|
|
63
|
+
email?: string | undefined;
|
|
64
|
+
inviteTokenTenantName?: string | undefined;
|
|
65
|
+
inviteTokenError?: string | undefined;
|
|
66
|
+
isNewUser?: boolean | undefined;
|
|
57
67
|
};
|
|
58
68
|
user: undefined;
|
|
59
69
|
isAuthenticated: boolean;
|
|
60
|
-
}, {
|
|
70
|
+
}, AuthState & {
|
|
61
71
|
isAllowedToRemember: any;
|
|
62
72
|
mfaDeviceExpiration: any;
|
|
63
73
|
}> | CallEffect<ILoginResponse> | import("redux-saga/effects").PutEffect<{
|
package/auth/SSOState/index.d.ts
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
|
-
import { CreateSamlGroupPayload, DeleteSamlGroupPayload, SaveSSOConfigurationFilePayload, SaveSSOConfigurationPayload, SSOState, UpdateSSOAuthorizationRolesPayload } from './interfaces';
|
|
1
|
+
import { CreateSamlGroupPayload, DeleteSamlGroupPayload, SaveSSOConfigurationFilePayload, SaveSSOConfigurationPayload, ValidateSSODomainPayload, SSOState, SSOStateIndicator, UpdateSSOAuthorizationRolesPayload, SaveSSODomainPayload, UpdateSSOConfigurationPayload, DeleteSSOConfigurationPayload, SaveSSOConfigurationPayloadV2, UpdateSSODefaultRolesPayload, SetSSOGroupsPayload, SaveSSOConfigurationByMetadataPayload, UpdateSSOConfigurationByMetadataPayload } from './interfaces';
|
|
2
2
|
import { WithCallback } from '../../interfaces';
|
|
3
3
|
import { IOidcPostLogin } from '@frontegg/rest-api';
|
|
4
4
|
declare const ssoState: SSOState;
|
|
5
5
|
declare const reducers: {
|
|
6
|
+
setSSOLoader: {
|
|
7
|
+
prepare: (payload: SSOStateIndicator) => {
|
|
8
|
+
payload: SSOStateIndicator;
|
|
9
|
+
};
|
|
10
|
+
reducer: (state: import("..").AuthState, { payload }: {
|
|
11
|
+
payload: SSOStateIndicator;
|
|
12
|
+
type: string;
|
|
13
|
+
}) => import("..").AuthState;
|
|
14
|
+
};
|
|
15
|
+
setSSOError: {
|
|
16
|
+
prepare: (payload: SSOStateIndicator) => {
|
|
17
|
+
payload: SSOStateIndicator;
|
|
18
|
+
};
|
|
19
|
+
reducer: (state: import("..").AuthState, { payload }: {
|
|
20
|
+
payload: SSOStateIndicator;
|
|
21
|
+
type: string;
|
|
22
|
+
}) => import("..").AuthState;
|
|
23
|
+
};
|
|
6
24
|
setSSOState: {
|
|
7
25
|
prepare: (payload: Partial<SSOState>) => {
|
|
8
26
|
payload: Partial<SSOState>;
|
|
@@ -69,11 +87,70 @@ declare const reducers: {
|
|
|
69
87
|
};
|
|
70
88
|
};
|
|
71
89
|
declare const actions: {
|
|
90
|
+
loadSSOConfigurationsV2: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
91
|
+
saveSSOConfigurationV2: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<Partial<Pick<import("@frontegg/rest-api").ISSOConfiguration, "enabled" | "generatedVerification" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "type" | "spEntityId" | "oidcClientId" | "oidcSecret" | "roleIds" | "groups">>, import("@frontegg/rest-api").ISSOConfiguration>], WithCallback<Partial<Pick<import("@frontegg/rest-api").ISSOConfiguration, "enabled" | "generatedVerification" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "type" | "spEntityId" | "oidcClientId" | "oidcSecret" | "roleIds" | "groups">>, import("@frontegg/rest-api").ISSOConfiguration>, string, never, never>;
|
|
92
|
+
updateSSOConfiguration: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<Partial<Pick<import("@frontegg/rest-api").ISSOConfiguration, "enabled" | "generatedVerification" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "type" | "spEntityId" | "oidcClientId" | "oidcSecret" | "roleIds" | "groups">> & {
|
|
93
|
+
ssoConfigId: string;
|
|
94
|
+
}, import("@frontegg/rest-api").ISSOConfiguration>], WithCallback<Partial<Pick<import("@frontegg/rest-api").ISSOConfiguration, "enabled" | "generatedVerification" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "type" | "spEntityId" | "oidcClientId" | "oidcSecret" | "roleIds" | "groups">> & {
|
|
95
|
+
ssoConfigId: string;
|
|
96
|
+
}, import("@frontegg/rest-api").ISSOConfiguration>, string, never, never>;
|
|
97
|
+
deleteSSOConfiguration: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<{
|
|
98
|
+
ssoConfigId: string;
|
|
99
|
+
}, boolean>], WithCallback<{
|
|
100
|
+
ssoConfigId: string;
|
|
101
|
+
}, boolean>, string, never, never>;
|
|
102
|
+
saveSSODomain: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<import("@frontegg/rest-api").ICreateSSODomain & {
|
|
103
|
+
ssoConfigId: string;
|
|
104
|
+
}, import("@frontegg/rest-api").ISSODomain>], WithCallback<import("@frontegg/rest-api").ICreateSSODomain & {
|
|
105
|
+
ssoConfigId: string;
|
|
106
|
+
}, import("@frontegg/rest-api").ISSODomain>, string, never, never>;
|
|
107
|
+
deleteSSODomain: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<{
|
|
108
|
+
domainId: string;
|
|
109
|
+
ssoConfigId: string;
|
|
110
|
+
}, boolean>], WithCallback<{
|
|
111
|
+
domainId: string;
|
|
112
|
+
ssoConfigId: string;
|
|
113
|
+
}, boolean>, string, never, never>;
|
|
114
|
+
validateSSODomainV2: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<{
|
|
115
|
+
domainId: string;
|
|
116
|
+
ssoConfigId: string;
|
|
117
|
+
}, boolean>], WithCallback<{
|
|
118
|
+
domainId: string;
|
|
119
|
+
ssoConfigId: string;
|
|
120
|
+
}, boolean>, string, never, never>;
|
|
121
|
+
setSSODefaultRoles: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<{
|
|
122
|
+
roleIds: string[];
|
|
123
|
+
ssoConfigId: string;
|
|
124
|
+
}, boolean>], WithCallback<{
|
|
125
|
+
roleIds: string[];
|
|
126
|
+
ssoConfigId: string;
|
|
127
|
+
}, boolean>, string, never, never>;
|
|
128
|
+
setSSOGroups: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<{
|
|
129
|
+
ssoConfigId: string;
|
|
130
|
+
groupsToAdd: import("@frontegg/rest-api").ICreateSamlGroup[];
|
|
131
|
+
groupsToDelete: string[];
|
|
132
|
+
}, boolean>], WithCallback<{
|
|
133
|
+
ssoConfigId: string;
|
|
134
|
+
groupsToAdd: import("@frontegg/rest-api").ICreateSamlGroup[];
|
|
135
|
+
groupsToDelete: string[];
|
|
136
|
+
}, boolean>, string, never, never>;
|
|
137
|
+
saveSSOConfigurationByMetadata: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<{
|
|
138
|
+
configFile: File;
|
|
139
|
+
}, import("@frontegg/rest-api").ISSOConfiguration>], WithCallback<{
|
|
140
|
+
configFile: File;
|
|
141
|
+
}, import("@frontegg/rest-api").ISSOConfiguration>, string, never, never>;
|
|
142
|
+
updateSSOConfigurationByMetadata: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<{
|
|
143
|
+
configFile: File;
|
|
144
|
+
ssoConfigId: string;
|
|
145
|
+
}, import("@frontegg/rest-api").ISSOConfiguration>], WithCallback<{
|
|
146
|
+
configFile: File;
|
|
147
|
+
ssoConfigId: string;
|
|
148
|
+
}, import("@frontegg/rest-api").ISSOConfiguration>, string, never, never>;
|
|
72
149
|
loadSSOConfigurations: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
73
150
|
loadSSOAuthorizationRoles: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
74
|
-
saveSSOConfigurations: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<Partial<import("@frontegg/rest-api").ISamlConfiguration & {
|
|
151
|
+
saveSSOConfigurations: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<Partial<Pick<import("@frontegg/rest-api").ISamlConfiguration, "enabled" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "type" | "spEntityId" | "oidcClientId" | "oidcSecret" | "domain" | "isSamlActive"> & {
|
|
75
152
|
samlVendor: import("./interfaces").SamlVendors;
|
|
76
|
-
}>, boolean>], WithCallback<Partial<import("@frontegg/rest-api").ISamlConfiguration & {
|
|
153
|
+
}>, boolean>], WithCallback<Partial<Pick<import("@frontegg/rest-api").ISamlConfiguration, "enabled" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "type" | "spEntityId" | "oidcClientId" | "oidcSecret" | "domain" | "isSamlActive"> & {
|
|
77
154
|
samlVendor: import("./interfaces").SamlVendors;
|
|
78
155
|
}>, boolean>, string, never, never>;
|
|
79
156
|
saveSSOConfigurationsFile: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[File[]], File[], string, never, never>;
|
|
@@ -107,6 +184,19 @@ declare const actions: {
|
|
|
107
184
|
* the reducers and actions as standalone function
|
|
108
185
|
*/
|
|
109
186
|
declare type DispatchedActions = {
|
|
187
|
+
loadSSOConfigurationsV2: () => void;
|
|
188
|
+
saveSSOConfigurationV2: (payload: SaveSSOConfigurationPayloadV2) => void;
|
|
189
|
+
updateSSOConfiguration: (payload: UpdateSSOConfigurationPayload) => void;
|
|
190
|
+
deleteSSOConfiguration: (payload: DeleteSSOConfigurationPayload) => void;
|
|
191
|
+
deleteSSODomain: (payload: ValidateSSODomainPayload) => void;
|
|
192
|
+
saveSSODomain: (payload: SaveSSODomainPayload) => void;
|
|
193
|
+
validateSSODomainV2: (payload: ValidateSSODomainPayload) => void;
|
|
194
|
+
setSSODefaultRoles: (payload: UpdateSSODefaultRolesPayload) => void;
|
|
195
|
+
setSSOGroups: (payload: SetSSOGroupsPayload) => void;
|
|
196
|
+
saveSSOConfigurationByMetadata: (payload: SaveSSOConfigurationByMetadataPayload) => void;
|
|
197
|
+
updateSSOConfigurationByMetadata: (payload: UpdateSSOConfigurationByMetadataPayload) => void;
|
|
198
|
+
setSSOLoader: (payload: SSOStateIndicator) => void;
|
|
199
|
+
setSSOError: (payload: SSOStateIndicator) => void;
|
|
110
200
|
setSSOState: (state: Partial<SSOState>) => void;
|
|
111
201
|
resetSSOState: () => void;
|
|
112
202
|
loadSSOConfigurations: () => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ICreateSamlGroup, ISamlConfiguration, ISamlRolesGroup, IOidcConfiguration, ITeamUserRole } from '@frontegg/rest-api';
|
|
1
|
+
import { ICreateSamlGroup, ISamlConfiguration, ISamlRolesGroup, IOidcConfiguration, ITeamUserRole, ICreateSSODomain, ISSODomain, IUpdateSamlConfiguration, ISamlMetadata, IUpdateSSOConfiguration, ISSOConfiguration } from '@frontegg/rest-api';
|
|
2
2
|
import { WithCallback } from '../../interfaces';
|
|
3
|
+
export { ISSOConfiguration, ISSODomain };
|
|
3
4
|
export interface SSOState {
|
|
4
5
|
firstLoad: boolean;
|
|
5
6
|
loading: boolean;
|
|
@@ -10,6 +11,29 @@ export interface SSOState {
|
|
|
10
11
|
roles?: ITeamUserRole[];
|
|
11
12
|
rolesGroups?: ISamlRolesGroup[];
|
|
12
13
|
authorizationRoles?: string[];
|
|
14
|
+
ssoConfigurations: ISSOConfiguration[];
|
|
15
|
+
errors: any;
|
|
16
|
+
loaders: any;
|
|
17
|
+
samlMetadata?: ISamlMetadata;
|
|
18
|
+
}
|
|
19
|
+
export declare type SSOStateIndicator = {
|
|
20
|
+
key: SSOStateKeys;
|
|
21
|
+
value: string | boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare enum SSOStateKeys {
|
|
24
|
+
LOAD_SSO_CONFIGURATIONS = "LOAD_SSO_CONFIGURATIONS",
|
|
25
|
+
SAVE_SSO_CONFIGURATION = "SAVE_SSO_CONFIGURATION",
|
|
26
|
+
UPDATE_SSO_CONFIGURATION = "UPDATE_SSO_CONFIGURATION",
|
|
27
|
+
SAVE_SSO_CONFIGURATION_BY_METADATA = "SAVE_SSO_CONFIGURATION_BY_METADATA",
|
|
28
|
+
UPDATE_SSO_CONFIGURATION_BY_METADATA = "UPDATE_SSO_CONFIGURATION",
|
|
29
|
+
DELETE_SSO_CONFIGURATION = "DELETE_SSO_CONFIGURATION",
|
|
30
|
+
SAVE_SSO_DOMAIN = "SAVE_SSO_DOMAIN",
|
|
31
|
+
DELETE_SSO_DOMAIN = "DELETE_SSO_DOMAIN",
|
|
32
|
+
VALIDATE_SSO_DOMAIN = "VALIDATE_SSO_DOMAIN",
|
|
33
|
+
UPDATE_SSO_DEFAULT_ROLES = "UPDATE_SSO_DEFAULT_ROLES",
|
|
34
|
+
DELETE_SSO_GROUPS = "DELETE_SSO_GROUPS",
|
|
35
|
+
SAVE_SSO_GROUPS = "SAVE_SSO_GROUPS",
|
|
36
|
+
GET_SSO_AUTHORIZATION_ROLES = "GET_SSO_AUTHORIZATION_ROLES"
|
|
13
37
|
}
|
|
14
38
|
export declare enum SamlVendors {
|
|
15
39
|
Saml = "saml",
|
|
@@ -18,9 +42,39 @@ export declare enum SamlVendors {
|
|
|
18
42
|
Google = "google",
|
|
19
43
|
Oidc = "oidc"
|
|
20
44
|
}
|
|
21
|
-
export declare type
|
|
45
|
+
export declare type SetSSOGroupsPayload = WithCallback<{
|
|
46
|
+
ssoConfigId: string;
|
|
47
|
+
groupsToAdd: ICreateSamlGroup[];
|
|
48
|
+
groupsToDelete: string[];
|
|
49
|
+
}>;
|
|
50
|
+
export declare type UpdateSSODefaultRolesPayload = WithCallback<{
|
|
51
|
+
roleIds: string[];
|
|
52
|
+
ssoConfigId: string;
|
|
53
|
+
}>;
|
|
54
|
+
export declare type SaveSSODomainPayload = WithCallback<ICreateSSODomain & {
|
|
55
|
+
ssoConfigId: string;
|
|
56
|
+
}, ISSODomain>;
|
|
57
|
+
export declare type ValidateSSODomainPayload = WithCallback<{
|
|
58
|
+
domainId: string;
|
|
59
|
+
ssoConfigId: string;
|
|
60
|
+
}>;
|
|
61
|
+
export declare type SaveSSOConfigurationPayload = WithCallback<Partial<IUpdateSamlConfiguration & {
|
|
22
62
|
samlVendor: SamlVendors;
|
|
23
63
|
}>>;
|
|
64
|
+
export declare type SaveSSOConfigurationPayloadV2 = WithCallback<IUpdateSSOConfiguration, ISSOConfiguration>;
|
|
65
|
+
export declare type SaveSSOConfigurationByMetadataPayload = WithCallback<{
|
|
66
|
+
configFile: File;
|
|
67
|
+
}, ISSOConfiguration>;
|
|
68
|
+
export declare type UpdateSSOConfigurationByMetadataPayload = WithCallback<{
|
|
69
|
+
configFile: File;
|
|
70
|
+
ssoConfigId: string;
|
|
71
|
+
}, ISSOConfiguration>;
|
|
72
|
+
export declare type UpdateSSOConfigurationPayload = WithCallback<IUpdateSSOConfiguration & {
|
|
73
|
+
ssoConfigId: string;
|
|
74
|
+
}, ISSOConfiguration>;
|
|
75
|
+
export declare type DeleteSSOConfigurationPayload = WithCallback<{
|
|
76
|
+
ssoConfigId: string;
|
|
77
|
+
}>;
|
|
24
78
|
export declare type SaveSSOConfigurationFilePayload = WithCallback<{
|
|
25
79
|
configFile: File;
|
|
26
80
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ssoSagas(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
package/auth/index.d.ts
CHANGED
|
@@ -122,11 +122,70 @@ declare const _default: {
|
|
|
122
122
|
verifyMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IVerifyMfa, string | undefined>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IVerifyMfa, string | undefined>, string, never, never>;
|
|
123
123
|
verifyMfaAfterForce: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, string | undefined>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, string | undefined>, string, never, never>;
|
|
124
124
|
disableMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IDisableMfa, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IDisableMfa, boolean>, string, never, never>;
|
|
125
|
+
loadSSOConfigurationsV2: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
126
|
+
saveSSOConfigurationV2: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<Partial<Pick<import("@frontegg/rest-api/dist/auth/interfaces").ISSOConfiguration, "roleIds" | "enabled" | "generatedVerification" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "spEntityId" | "oidcClientId" | "oidcSecret" | "type" | "groups">>, import("@frontegg/rest-api/dist/auth/interfaces").ISSOConfiguration>], import("../interfaces").WithCallback<Partial<Pick<import("@frontegg/rest-api/dist/auth/interfaces").ISSOConfiguration, "roleIds" | "enabled" | "generatedVerification" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "spEntityId" | "oidcClientId" | "oidcSecret" | "type" | "groups">>, import("@frontegg/rest-api/dist/auth/interfaces").ISSOConfiguration>, string, never, never>;
|
|
127
|
+
updateSSOConfiguration: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<Partial<Pick<import("@frontegg/rest-api/dist/auth/interfaces").ISSOConfiguration, "roleIds" | "enabled" | "generatedVerification" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "spEntityId" | "oidcClientId" | "oidcSecret" | "type" | "groups">> & {
|
|
128
|
+
ssoConfigId: string;
|
|
129
|
+
}, import("@frontegg/rest-api/dist/auth/interfaces").ISSOConfiguration>], import("../interfaces").WithCallback<Partial<Pick<import("@frontegg/rest-api/dist/auth/interfaces").ISSOConfiguration, "roleIds" | "enabled" | "generatedVerification" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "spEntityId" | "oidcClientId" | "oidcSecret" | "type" | "groups">> & {
|
|
130
|
+
ssoConfigId: string;
|
|
131
|
+
}, import("@frontegg/rest-api/dist/auth/interfaces").ISSOConfiguration>, string, never, never>;
|
|
132
|
+
deleteSSOConfiguration: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<{
|
|
133
|
+
ssoConfigId: string;
|
|
134
|
+
}, boolean>], import("../interfaces").WithCallback<{
|
|
135
|
+
ssoConfigId: string;
|
|
136
|
+
}, boolean>, string, never, never>;
|
|
137
|
+
saveSSODomain: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ICreateSSODomain & {
|
|
138
|
+
ssoConfigId: string;
|
|
139
|
+
}, import("@frontegg/rest-api/dist/auth/interfaces").ISSODomain>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ICreateSSODomain & {
|
|
140
|
+
ssoConfigId: string;
|
|
141
|
+
}, import("@frontegg/rest-api/dist/auth/interfaces").ISSODomain>, string, never, never>;
|
|
142
|
+
deleteSSODomain: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<{
|
|
143
|
+
domainId: string;
|
|
144
|
+
ssoConfigId: string;
|
|
145
|
+
}, boolean>], import("../interfaces").WithCallback<{
|
|
146
|
+
domainId: string;
|
|
147
|
+
ssoConfigId: string;
|
|
148
|
+
}, boolean>, string, never, never>;
|
|
149
|
+
validateSSODomainV2: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<{
|
|
150
|
+
domainId: string;
|
|
151
|
+
ssoConfigId: string;
|
|
152
|
+
}, boolean>], import("../interfaces").WithCallback<{
|
|
153
|
+
domainId: string;
|
|
154
|
+
ssoConfigId: string;
|
|
155
|
+
}, boolean>, string, never, never>;
|
|
156
|
+
setSSODefaultRoles: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<{
|
|
157
|
+
roleIds: string[];
|
|
158
|
+
ssoConfigId: string;
|
|
159
|
+
}, boolean>], import("../interfaces").WithCallback<{
|
|
160
|
+
roleIds: string[];
|
|
161
|
+
ssoConfigId: string;
|
|
162
|
+
}, boolean>, string, never, never>;
|
|
163
|
+
setSSOGroups: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<{
|
|
164
|
+
ssoConfigId: string;
|
|
165
|
+
groupsToAdd: import("@frontegg/rest-api").ICreateSamlGroup[];
|
|
166
|
+
groupsToDelete: string[];
|
|
167
|
+
}, boolean>], import("../interfaces").WithCallback<{
|
|
168
|
+
ssoConfigId: string;
|
|
169
|
+
groupsToAdd: import("@frontegg/rest-api").ICreateSamlGroup[];
|
|
170
|
+
groupsToDelete: string[];
|
|
171
|
+
}, boolean>, string, never, never>;
|
|
172
|
+
saveSSOConfigurationByMetadata: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<{
|
|
173
|
+
configFile: File;
|
|
174
|
+
}, import("@frontegg/rest-api/dist/auth/interfaces").ISSOConfiguration>], import("../interfaces").WithCallback<{
|
|
175
|
+
configFile: File;
|
|
176
|
+
}, import("@frontegg/rest-api/dist/auth/interfaces").ISSOConfiguration>, string, never, never>;
|
|
177
|
+
updateSSOConfigurationByMetadata: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<{
|
|
178
|
+
configFile: File;
|
|
179
|
+
ssoConfigId: string;
|
|
180
|
+
}, import("@frontegg/rest-api/dist/auth/interfaces").ISSOConfiguration>], import("../interfaces").WithCallback<{
|
|
181
|
+
configFile: File;
|
|
182
|
+
ssoConfigId: string;
|
|
183
|
+
}, import("@frontegg/rest-api/dist/auth/interfaces").ISSOConfiguration>, string, never, never>;
|
|
125
184
|
loadSSOConfigurations: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
126
185
|
loadSSOAuthorizationRoles: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
127
|
-
saveSSOConfigurations: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<Partial<import("@frontegg/rest-api").ISamlConfiguration & {
|
|
186
|
+
saveSSOConfigurations: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<Partial<Pick<import("@frontegg/rest-api").ISamlConfiguration, "enabled" | "domain" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "spEntityId" | "isSamlActive" | "oidcClientId" | "oidcSecret" | "type"> & {
|
|
128
187
|
samlVendor: import("./SSOState/interfaces").SamlVendors;
|
|
129
|
-
}>, boolean>], import("../interfaces").WithCallback<Partial<import("@frontegg/rest-api").ISamlConfiguration & {
|
|
188
|
+
}>, boolean>], import("../interfaces").WithCallback<Partial<Pick<import("@frontegg/rest-api").ISamlConfiguration, "enabled" | "domain" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "spEntityId" | "isSamlActive" | "oidcClientId" | "oidcSecret" | "type"> & {
|
|
130
189
|
samlVendor: import("./SSOState/interfaces").SamlVendors;
|
|
131
190
|
}>, boolean>, string, never, never>;
|
|
132
191
|
saveSSOConfigurationsFile: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[File[]], File[], string, never, never>;
|
|
@@ -245,6 +304,8 @@ declare const _default: {
|
|
|
245
304
|
resetTeamState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
246
305
|
setMfaState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./MfaState/interfaces").MFAState>], Partial<import("./MfaState/interfaces").MFAState>, string, never, never>;
|
|
247
306
|
resetMfaState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
307
|
+
setSSOLoader: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./SSOState/interfaces").SSOStateIndicator], import("./SSOState/interfaces").SSOStateIndicator, string, never, never>;
|
|
308
|
+
setSSOError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./SSOState/interfaces").SSOStateIndicator], import("./SSOState/interfaces").SSOStateIndicator, string, never, never>;
|
|
248
309
|
setSSOState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./SSOState/interfaces").SSOState>], Partial<import("./SSOState/interfaces").SSOState>, string, never, never>;
|
|
249
310
|
resetSSOState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
250
311
|
setProfileState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./ProfileState/interfaces").ProfileState>], Partial<import("./ProfileState/interfaces").ProfileState>, string, never, never>;
|
package/auth/index.js
CHANGED
|
@@ -159,12 +159,28 @@ const ssoState = {
|
|
|
159
159
|
firstLoad: true,
|
|
160
160
|
loading: true,
|
|
161
161
|
saving: false,
|
|
162
|
+
errors: {},
|
|
163
|
+
loaders: {},
|
|
164
|
+
ssoConfigurations: []
|
|
162
165
|
};
|
|
163
166
|
const reducers$a = {
|
|
167
|
+
setSSOLoader: loadersReducerForKey('ssoState'),
|
|
168
|
+
setSSOError: errorsReducerForKey('ssoState'),
|
|
164
169
|
setSSOState: typeReducerForKey('ssoState'),
|
|
165
170
|
resetSSOState: resetStateByKey('ssoState', { ssoState }),
|
|
166
171
|
};
|
|
167
172
|
const actions$b = {
|
|
173
|
+
loadSSOConfigurationsV2: createAction(`${authStoreName}/loadSSOConfigurationsV2`),
|
|
174
|
+
saveSSOConfigurationV2: createAction(`${authStoreName}/saveSSOConfigurationV2`, (payload) => ({ payload })),
|
|
175
|
+
updateSSOConfiguration: createAction(`${authStoreName}/updateSSOConfiguration`, (payload) => ({ payload })),
|
|
176
|
+
deleteSSOConfiguration: createAction(`${authStoreName}/deleteSSOConfiguration`, (payload) => ({ payload })),
|
|
177
|
+
saveSSODomain: createAction(`${authStoreName}/saveSSODomain`, (payload) => ({ payload })),
|
|
178
|
+
deleteSSODomain: createAction(`${authStoreName}/deleteSSODomain`, (payload) => ({ payload })),
|
|
179
|
+
validateSSODomainV2: createAction(`${authStoreName}/validateSSODomainV2`, (payload) => ({ payload })),
|
|
180
|
+
setSSODefaultRoles: createAction(`${authStoreName}/setSSODefaultRoles`, (payload) => ({ payload })),
|
|
181
|
+
setSSOGroups: createAction(`${authStoreName}/setSSOGroups`, (payload) => ({ payload })),
|
|
182
|
+
saveSSOConfigurationByMetadata: createAction(`${authStoreName}/saveSSOConfigurationByMetadata`, (payload) => ({ payload })),
|
|
183
|
+
updateSSOConfigurationByMetadata: createAction(`${authStoreName}/updateSSOConfigurationByMetadata`, (payload) => ({ payload })),
|
|
168
184
|
loadSSOConfigurations: createAction(`${authStoreName}/loadSSOConfigurations`),
|
|
169
185
|
loadSSOAuthorizationRoles: createAction(`${authStoreName}/loadSSOAuthorizationRoles`),
|
|
170
186
|
saveSSOConfigurations: createAction(`${authStoreName}/saveSSOConfigurations`, (payload) => ({ payload })),
|
|
@@ -492,6 +508,22 @@ const { reducer, actions: sliceActions } = createSlice({
|
|
|
492
508
|
});
|
|
493
509
|
const actions = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sliceActions), actions$f), actions$7), actions$e), actions$d), actions$c), actions$6), actions$a), actions$b), actions$9), actions$8), actions$5), actions$4), actions$3), actions$2), actions$1);
|
|
494
510
|
|
|
511
|
+
var SSOStateKeys;
|
|
512
|
+
(function (SSOStateKeys) {
|
|
513
|
+
SSOStateKeys["LOAD_SSO_CONFIGURATIONS"] = "LOAD_SSO_CONFIGURATIONS";
|
|
514
|
+
SSOStateKeys["SAVE_SSO_CONFIGURATION"] = "SAVE_SSO_CONFIGURATION";
|
|
515
|
+
SSOStateKeys["UPDATE_SSO_CONFIGURATION"] = "UPDATE_SSO_CONFIGURATION";
|
|
516
|
+
SSOStateKeys["SAVE_SSO_CONFIGURATION_BY_METADATA"] = "SAVE_SSO_CONFIGURATION_BY_METADATA";
|
|
517
|
+
SSOStateKeys["UPDATE_SSO_CONFIGURATION_BY_METADATA"] = "UPDATE_SSO_CONFIGURATION";
|
|
518
|
+
SSOStateKeys["DELETE_SSO_CONFIGURATION"] = "DELETE_SSO_CONFIGURATION";
|
|
519
|
+
SSOStateKeys["SAVE_SSO_DOMAIN"] = "SAVE_SSO_DOMAIN";
|
|
520
|
+
SSOStateKeys["DELETE_SSO_DOMAIN"] = "DELETE_SSO_DOMAIN";
|
|
521
|
+
SSOStateKeys["VALIDATE_SSO_DOMAIN"] = "VALIDATE_SSO_DOMAIN";
|
|
522
|
+
SSOStateKeys["UPDATE_SSO_DEFAULT_ROLES"] = "UPDATE_SSO_DEFAULT_ROLES";
|
|
523
|
+
SSOStateKeys["DELETE_SSO_GROUPS"] = "DELETE_SSO_GROUPS";
|
|
524
|
+
SSOStateKeys["SAVE_SSO_GROUPS"] = "SAVE_SSO_GROUPS";
|
|
525
|
+
SSOStateKeys["GET_SSO_AUTHORIZATION_ROLES"] = "GET_SSO_AUTHORIZATION_ROLES";
|
|
526
|
+
})(SSOStateKeys || (SSOStateKeys = {}));
|
|
495
527
|
var SamlVendors;
|
|
496
528
|
(function (SamlVendors) {
|
|
497
529
|
SamlVendors["Saml"] = "saml";
|
|
@@ -678,6 +710,9 @@ const ssoStateDemo = {
|
|
|
678
710
|
samlConfiguration: samlConfigurationDemo,
|
|
679
711
|
roles: rolesDemo,
|
|
680
712
|
authorizationRoles: [],
|
|
713
|
+
errors: {},
|
|
714
|
+
loaders: {},
|
|
715
|
+
ssoConfigurations: [],
|
|
681
716
|
};
|
|
682
717
|
const permissionsDemo = [
|
|
683
718
|
{
|
|
@@ -1049,6 +1084,7 @@ const isMfaRequired = (user) => {
|
|
|
1049
1084
|
function* getMfaRequiredState(user) {
|
|
1050
1085
|
let setMfaState = {};
|
|
1051
1086
|
let step = LoginStep.loginWithTwoFactor;
|
|
1087
|
+
const { loginState } = yield select((state) => state.auth);
|
|
1052
1088
|
const { isAllowedToRemember, mfaDeviceExpiration } = yield call(api.auth.checkIfAllowToRememberMfaDevice, user.mfaToken);
|
|
1053
1089
|
if (user.hasOwnProperty('mfaEnrolled') && !user.mfaEnrolled) {
|
|
1054
1090
|
setMfaState = {
|
|
@@ -1062,17 +1098,7 @@ function* getMfaRequiredState(user) {
|
|
|
1062
1098
|
};
|
|
1063
1099
|
step = LoginStep.forceTwoFactor;
|
|
1064
1100
|
}
|
|
1065
|
-
return Object.assign(Object.assign({ user: undefined, isAuthenticated: false }, setMfaState), { loginState: {
|
|
1066
|
-
mfaToken: user.mfaToken,
|
|
1067
|
-
mfaRequired: user.mfaRequired,
|
|
1068
|
-
loading: false,
|
|
1069
|
-
error: undefined,
|
|
1070
|
-
step,
|
|
1071
|
-
tenantsLoading: true,
|
|
1072
|
-
tenants: [],
|
|
1073
|
-
allowRememberMfaDevice: isAllowedToRemember,
|
|
1074
|
-
mfaDeviceExpiration,
|
|
1075
|
-
} });
|
|
1101
|
+
return Object.assign(Object.assign({ user: undefined, isAuthenticated: false }, setMfaState), { loginState: Object.assign(Object.assign({}, loginState), { mfaToken: user.mfaToken, mfaRequired: user.mfaRequired, loading: false, error: undefined, step, tenantsLoading: true, tenants: [], allowRememberMfaDevice: isAllowedToRemember, mfaDeviceExpiration }) });
|
|
1076
1102
|
}
|
|
1077
1103
|
function* refreshToken() {
|
|
1078
1104
|
try {
|
|
@@ -1087,7 +1113,7 @@ function* refreshToken() {
|
|
|
1087
1113
|
else {
|
|
1088
1114
|
yield put(actions.loadTenants());
|
|
1089
1115
|
yield put(actions.setState({ user, isAuthenticated: true }));
|
|
1090
|
-
if ([routes.loginUrl, routes.socialLoginCallbackUrl, routes.signUpUrl, routes.oidcRedirectUrl].
|
|
1116
|
+
if ([routes.loginUrl, routes.socialLoginCallbackUrl, routes.signUpUrl, routes.oidcRedirectUrl].some(url => url && window.location.pathname.endsWith(url)) ||
|
|
1091
1117
|
(window.location.pathname.endsWith(routes.activateUrl) && user.verified)) {
|
|
1092
1118
|
if (loginState.isNewUser && routes.signUpSuccessUrl && routes.socialLoginCallbackUrl === window.location.pathname) {
|
|
1093
1119
|
onRedirectTo(routes.signUpSuccessUrl, { refresh: routes.signUpSuccessUrl.startsWith('http') });
|
|
@@ -1219,7 +1245,7 @@ function* preLogin({ payload: { email, recaptchaToken, callback } }) {
|
|
|
1219
1245
|
yield put(actions.setLoginState({ loading: true }));
|
|
1220
1246
|
try {
|
|
1221
1247
|
const onRedirectTo = yield select(({ auth: { onRedirectTo } }) => onRedirectTo);
|
|
1222
|
-
let { address, idpType } = yield call(api.auth.
|
|
1248
|
+
let { address, idpType } = yield call(api.auth.preLoginV2, { email });
|
|
1223
1249
|
if (address) {
|
|
1224
1250
|
if (idpType === SamlVendors.Oidc && !address.includes('redirect_uri')) {
|
|
1225
1251
|
const { routes: { oidcRedirectUrl } } = yield select(({ auth: { routes } }) => ({ routes }));
|
|
@@ -1613,9 +1639,10 @@ function* createSamlGroupFunction({ payload: { group, roleIds, callback } }) {
|
|
|
1613
1639
|
}
|
|
1614
1640
|
function* oidcPostloginFunction({ payload }) {
|
|
1615
1641
|
var _a;
|
|
1642
|
+
const data = { code: payload.code, redirectUri: payload.redirectUri, RelayState: payload.state };
|
|
1616
1643
|
try {
|
|
1617
1644
|
yield put(actions.setSSOState({ loading: true }));
|
|
1618
|
-
yield call(api.auth.
|
|
1645
|
+
yield call(api.auth.oidcPostLoginV2, data);
|
|
1619
1646
|
yield refreshToken();
|
|
1620
1647
|
yield put(actions.setSSOState({ loading: false }));
|
|
1621
1648
|
}
|
|
@@ -1623,7 +1650,7 @@ function* oidcPostloginFunction({ payload }) {
|
|
|
1623
1650
|
yield put(actions.setSSOState({ loading: false, error: (_a = e.message) !== null && _a !== void 0 ? _a : 'Failed to authenticate', firstLoad: false }));
|
|
1624
1651
|
}
|
|
1625
1652
|
}
|
|
1626
|
-
function* ssoSagas() {
|
|
1653
|
+
function* ssoSagas$1() {
|
|
1627
1654
|
yield takeEvery(actions.loadSSOConfigurations, loadSSOConfigurations);
|
|
1628
1655
|
yield takeEvery(actions.saveSSOConfigurations, saveSSOConfigurations);
|
|
1629
1656
|
yield takeEvery(actions.saveSSOConfigurationsFile, saveSSOConfigurationsFile);
|
|
@@ -1720,6 +1747,247 @@ function* ssoSagasMock() {
|
|
|
1720
1747
|
yield takeEvery(actions.updateSSOAuthorizationRoles, updateAuthorizationRolesMock);
|
|
1721
1748
|
}
|
|
1722
1749
|
|
|
1750
|
+
function* loadConfigs() {
|
|
1751
|
+
const ssoConfigurations = yield call(api.auth.getSSOConfigurations);
|
|
1752
|
+
const oidcConfiguration = yield call(api.auth.getOidcConfiguration);
|
|
1753
|
+
const samlMetadata = yield call(api.metadata.getSamlMetadata);
|
|
1754
|
+
yield put(actions.setSSOState({
|
|
1755
|
+
ssoConfigurations,
|
|
1756
|
+
oidcConfiguration,
|
|
1757
|
+
samlMetadata
|
|
1758
|
+
}));
|
|
1759
|
+
}
|
|
1760
|
+
function* loadSSOConfigurationsV2() {
|
|
1761
|
+
try {
|
|
1762
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.LOAD_SSO_CONFIGURATIONS, value: true }));
|
|
1763
|
+
yield loadConfigs();
|
|
1764
|
+
}
|
|
1765
|
+
catch (error) {
|
|
1766
|
+
yield put(actions.setSSOError({ key: SSOStateKeys.LOAD_SSO_CONFIGURATIONS, value: error.message }));
|
|
1767
|
+
}
|
|
1768
|
+
finally {
|
|
1769
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.LOAD_SSO_CONFIGURATIONS, value: false }));
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
function* saveSSOConfigurationV2({ payload }) {
|
|
1773
|
+
var _a;
|
|
1774
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.SAVE_SSO_CONFIGURATION, value: true }));
|
|
1775
|
+
const { callback } = payload, ssoConfiguration = __rest(payload, ["callback"]);
|
|
1776
|
+
const ssoConfigurations = yield select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1777
|
+
try {
|
|
1778
|
+
const newSsoConfiguration = yield call(api.auth.createSSOConfiguration, Object.assign(Object.assign({}, ssoConfiguration), { enabled: (_a = ssoConfiguration.enabled) !== null && _a !== void 0 ? _a : false }));
|
|
1779
|
+
yield put(actions.setSSOState({ ssoConfigurations: [...ssoConfigurations, newSsoConfiguration] }));
|
|
1780
|
+
callback === null || callback === void 0 ? void 0 : callback(newSsoConfiguration);
|
|
1781
|
+
}
|
|
1782
|
+
catch (error) {
|
|
1783
|
+
yield put(actions.setSSOError({ key: SSOStateKeys.SAVE_SSO_CONFIGURATION, value: error.message }));
|
|
1784
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1785
|
+
}
|
|
1786
|
+
finally {
|
|
1787
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.SAVE_SSO_CONFIGURATION, value: false }));
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
function* saveSSOConfigurationByMetadata({ payload }) {
|
|
1791
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.SAVE_SSO_CONFIGURATION_BY_METADATA, value: true }));
|
|
1792
|
+
const { configFile, callback } = payload;
|
|
1793
|
+
const ssoConfigurations = yield select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1794
|
+
try {
|
|
1795
|
+
const metadata = yield readFileAsText(configFile);
|
|
1796
|
+
const newSsoConfiguration = yield call(api.auth.createSSOConfigurationByMetadata, { metadata });
|
|
1797
|
+
yield put(actions.setSSOState({ ssoConfigurations: [...ssoConfigurations, newSsoConfiguration] }));
|
|
1798
|
+
callback === null || callback === void 0 ? void 0 : callback(newSsoConfiguration);
|
|
1799
|
+
}
|
|
1800
|
+
catch (error) {
|
|
1801
|
+
yield put(actions.setSSOError({ key: SSOStateKeys.SAVE_SSO_CONFIGURATION_BY_METADATA, value: error.message }));
|
|
1802
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1803
|
+
}
|
|
1804
|
+
finally {
|
|
1805
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.SAVE_SSO_CONFIGURATION_BY_METADATA, value: false }));
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
function* updateSSOConfiguration({ payload }) {
|
|
1809
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.UPDATE_SSO_CONFIGURATION, value: true }));
|
|
1810
|
+
const { callback, ssoConfigId } = payload, ssoConfiguration = __rest(payload, ["callback", "ssoConfigId"]);
|
|
1811
|
+
const ssoConfigurations = yield select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1812
|
+
try {
|
|
1813
|
+
const newSsoConfiguration = yield call(api.auth.updateSSOConfiguration, ssoConfigId, ssoConfiguration);
|
|
1814
|
+
const newSsoConfigurations = ssoConfigurations.map((ssoConfig) => ssoConfig.id === ssoConfigId ? newSsoConfiguration : ssoConfig);
|
|
1815
|
+
yield put(actions.setSSOState({ ssoConfigurations: newSsoConfigurations }));
|
|
1816
|
+
callback === null || callback === void 0 ? void 0 : callback(newSsoConfiguration);
|
|
1817
|
+
}
|
|
1818
|
+
catch (error) {
|
|
1819
|
+
yield put(actions.setSSOError({ key: SSOStateKeys.UPDATE_SSO_CONFIGURATION, value: error.message }));
|
|
1820
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1821
|
+
}
|
|
1822
|
+
finally {
|
|
1823
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.UPDATE_SSO_CONFIGURATION, value: false }));
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
function* updateSSOConfigurationByMetadata({ payload }) {
|
|
1827
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.UPDATE_SSO_CONFIGURATION_BY_METADATA, value: true }));
|
|
1828
|
+
const { callback, ssoConfigId, configFile } = payload;
|
|
1829
|
+
const ssoConfigurations = yield select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1830
|
+
try {
|
|
1831
|
+
const metadata = yield readFileAsText(configFile);
|
|
1832
|
+
const newSsoConfiguration = yield call(api.auth.updateSSOConfigurationByMetadata, ssoConfigId, { metadata });
|
|
1833
|
+
const newSsoConfigurations = ssoConfigurations.map((ssoConfig) => ssoConfig.id === ssoConfigId ? newSsoConfiguration : ssoConfig);
|
|
1834
|
+
yield put(actions.setSSOState({ ssoConfigurations: newSsoConfigurations }));
|
|
1835
|
+
callback === null || callback === void 0 ? void 0 : callback(newSsoConfiguration);
|
|
1836
|
+
}
|
|
1837
|
+
catch (error) {
|
|
1838
|
+
yield put(actions.setSSOError({ key: SSOStateKeys.UPDATE_SSO_CONFIGURATION, value: error.message }));
|
|
1839
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1840
|
+
}
|
|
1841
|
+
finally {
|
|
1842
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.UPDATE_SSO_CONFIGURATION, value: false }));
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
function* deleteSSOConfiguration({ payload }) {
|
|
1846
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.DELETE_SSO_CONFIGURATION, value: true }));
|
|
1847
|
+
const { ssoConfigId, callback } = payload;
|
|
1848
|
+
const ssoConfigurations = yield select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1849
|
+
try {
|
|
1850
|
+
yield call(api.auth.deleteSSOConfiguration, ssoConfigId);
|
|
1851
|
+
yield put(actions.setSSOState({ ssoConfigurations: ssoConfigurations.filter(({ id }) => id !== ssoConfigId) }));
|
|
1852
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1853
|
+
}
|
|
1854
|
+
catch (error) {
|
|
1855
|
+
yield put(actions.setSSOError({ key: SSOStateKeys.DELETE_SSO_CONFIGURATION, value: error.message }));
|
|
1856
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1857
|
+
}
|
|
1858
|
+
finally {
|
|
1859
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.DELETE_SSO_CONFIGURATION, value: false }));
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
function* saveSSODomain({ payload }) {
|
|
1863
|
+
const { callback, ssoConfigId } = payload, body = __rest(payload, ["callback", "ssoConfigId"]);
|
|
1864
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.SAVE_SSO_DOMAIN, value: true }));
|
|
1865
|
+
const ssoConfigurations = yield select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1866
|
+
try {
|
|
1867
|
+
const domain = yield call(api.auth.createSSODomain, ssoConfigId, body);
|
|
1868
|
+
const newSsoConfigurations = ssoConfigurations.map((ssoConfig) => {
|
|
1869
|
+
if (ssoConfig.id === ssoConfigId) {
|
|
1870
|
+
return Object.assign(Object.assign({}, ssoConfig), { domains: [...ssoConfig.domains, domain] });
|
|
1871
|
+
}
|
|
1872
|
+
return ssoConfig;
|
|
1873
|
+
});
|
|
1874
|
+
yield put(actions.setSSOState({ ssoConfigurations: newSsoConfigurations }));
|
|
1875
|
+
callback === null || callback === void 0 ? void 0 : callback(domain);
|
|
1876
|
+
}
|
|
1877
|
+
catch (error) {
|
|
1878
|
+
yield put(actions.setSSOError({ key: SSOStateKeys.SAVE_SSO_DOMAIN, value: error.message }));
|
|
1879
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1880
|
+
}
|
|
1881
|
+
finally {
|
|
1882
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.SAVE_SSO_DOMAIN, value: false }));
|
|
1883
|
+
}
|
|
1884
|
+
}
|
|
1885
|
+
function* deleteSSODomain({ payload }) {
|
|
1886
|
+
const { ssoConfigId, domainId, callback } = payload;
|
|
1887
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.DELETE_SSO_DOMAIN, value: true }));
|
|
1888
|
+
const ssoConfigurations = yield select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1889
|
+
try {
|
|
1890
|
+
yield call(api.auth.deleteSSODomain, ssoConfigId, domainId);
|
|
1891
|
+
const newSsoConfigurations = ssoConfigurations.map((ssoConfig) => {
|
|
1892
|
+
if (ssoConfig.id === ssoConfigId) {
|
|
1893
|
+
return Object.assign(Object.assign({}, ssoConfig), { domains: ssoConfig.domains.filter(({ id }) => id !== domainId) });
|
|
1894
|
+
}
|
|
1895
|
+
return ssoConfig;
|
|
1896
|
+
});
|
|
1897
|
+
yield put(actions.setSSOState({ ssoConfigurations: newSsoConfigurations }));
|
|
1898
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1899
|
+
}
|
|
1900
|
+
catch (error) {
|
|
1901
|
+
yield put(actions.setSSOError({ key: SSOStateKeys.DELETE_SSO_DOMAIN, value: error.message }));
|
|
1902
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1903
|
+
}
|
|
1904
|
+
finally {
|
|
1905
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.DELETE_SSO_DOMAIN, value: false }));
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
function* validateSSODomainV2({ payload }) {
|
|
1909
|
+
const { callback, domainId, ssoConfigId } = payload;
|
|
1910
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.VALIDATE_SSO_DOMAIN, value: true }));
|
|
1911
|
+
const ssoConfigurations = yield select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1912
|
+
try {
|
|
1913
|
+
yield call(api.auth.validateSSODomain, ssoConfigId, domainId);
|
|
1914
|
+
const newSsoConfigurations = ssoConfigurations.map((ssoConfig) => {
|
|
1915
|
+
if (ssoConfig.id === ssoConfigId) {
|
|
1916
|
+
return Object.assign(Object.assign({}, ssoConfig), { domains: ssoConfig.domains.map((ssoDomain) => ssoDomain.id === domainId ? Object.assign(Object.assign({}, ssoDomain), { validated: true }) : ssoDomain) });
|
|
1917
|
+
}
|
|
1918
|
+
return ssoConfig;
|
|
1919
|
+
});
|
|
1920
|
+
yield put(actions.setSSOState({ ssoConfigurations: newSsoConfigurations }));
|
|
1921
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1922
|
+
}
|
|
1923
|
+
catch (error) {
|
|
1924
|
+
yield put(actions.setSSOError({ key: SSOStateKeys.VALIDATE_SSO_DOMAIN, value: error.message }));
|
|
1925
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1926
|
+
}
|
|
1927
|
+
finally {
|
|
1928
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.VALIDATE_SSO_DOMAIN, value: false }));
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
function* setSSODefaultRoles({ payload: { callback, ssoConfigId, roleIds }, }) {
|
|
1932
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.UPDATE_SSO_DEFAULT_ROLES, value: true }));
|
|
1933
|
+
const ssoConfigurations = yield select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1934
|
+
try {
|
|
1935
|
+
yield call(api.auth.setSSODefaultRoles, ssoConfigId, { roleIds });
|
|
1936
|
+
const newSsoConfigurations = ssoConfigurations.map((ssoConfig) => {
|
|
1937
|
+
if (ssoConfig.id === ssoConfigId) {
|
|
1938
|
+
return Object.assign(Object.assign({}, ssoConfig), { roleIds });
|
|
1939
|
+
}
|
|
1940
|
+
return ssoConfig;
|
|
1941
|
+
});
|
|
1942
|
+
yield put(actions.setSSOState({ ssoConfigurations: newSsoConfigurations }));
|
|
1943
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1944
|
+
}
|
|
1945
|
+
catch (error) {
|
|
1946
|
+
yield put(actions.setSSOError({ key: SSOStateKeys.UPDATE_SSO_DEFAULT_ROLES, value: error.message }));
|
|
1947
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1948
|
+
}
|
|
1949
|
+
finally {
|
|
1950
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.UPDATE_SSO_DEFAULT_ROLES, value: false }));
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
function* setSSOGroups({ payload: { groupsToAdd, groupsToDelete, ssoConfigId, callback } }) {
|
|
1954
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.SAVE_SSO_GROUPS, value: true }));
|
|
1955
|
+
const ssoConfigurations = yield select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1956
|
+
try {
|
|
1957
|
+
yield all(groupsToDelete.map((groupId) => call(api.auth.deleteSSOGroup, ssoConfigId, groupId)));
|
|
1958
|
+
yield all(groupsToAdd.map((group) => call(api.auth.createSSOGroup, ssoConfigId, group)));
|
|
1959
|
+
const groups = yield call(api.auth.getSSOGroups, ssoConfigId);
|
|
1960
|
+
const newSsoConfigurations = ssoConfigurations.map((ssoConfig) => {
|
|
1961
|
+
if (ssoConfig.id === ssoConfigId) {
|
|
1962
|
+
return Object.assign(Object.assign({}, ssoConfig), { groups });
|
|
1963
|
+
}
|
|
1964
|
+
return ssoConfig;
|
|
1965
|
+
});
|
|
1966
|
+
yield put(actions.setSSOState({ ssoConfigurations: newSsoConfigurations }));
|
|
1967
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1968
|
+
}
|
|
1969
|
+
catch (error) {
|
|
1970
|
+
yield put(actions.setSSOError({ key: SSOStateKeys.SAVE_SSO_GROUPS, value: error.message }));
|
|
1971
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1972
|
+
}
|
|
1973
|
+
finally {
|
|
1974
|
+
yield put(actions.setSSOLoader({ key: SSOStateKeys.SAVE_SSO_GROUPS, value: false }));
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
function* ssoSagas() {
|
|
1978
|
+
yield takeEvery(actions.loadSSOConfigurationsV2, loadSSOConfigurationsV2);
|
|
1979
|
+
yield takeEvery(actions.saveSSOConfigurationV2, saveSSOConfigurationV2);
|
|
1980
|
+
yield takeEvery(actions.saveSSODomain, saveSSODomain);
|
|
1981
|
+
yield takeEvery(actions.deleteSSODomain, deleteSSODomain);
|
|
1982
|
+
yield takeEvery(actions.validateSSODomainV2, validateSSODomainV2);
|
|
1983
|
+
yield takeEvery(actions.updateSSOConfiguration, updateSSOConfiguration);
|
|
1984
|
+
yield takeEvery(actions.deleteSSOConfiguration, deleteSSOConfiguration);
|
|
1985
|
+
yield takeEvery(actions.setSSOGroups, setSSOGroups);
|
|
1986
|
+
yield takeEvery(actions.setSSODefaultRoles, setSSODefaultRoles);
|
|
1987
|
+
yield takeEvery(actions.saveSSOConfigurationByMetadata, saveSSOConfigurationByMetadata);
|
|
1988
|
+
yield takeEvery(actions.updateSSOConfigurationByMetadata, updateSSOConfigurationByMetadata);
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1723
1991
|
function* loadProfile() {
|
|
1724
1992
|
yield put(actions.setProfileState({ loading: true }));
|
|
1725
1993
|
try {
|
|
@@ -2968,6 +3236,7 @@ function* sagas() {
|
|
|
2968
3236
|
call(activateSagas),
|
|
2969
3237
|
call(acceptInvitationSagas),
|
|
2970
3238
|
call(forgotPasswordSagas),
|
|
3239
|
+
call(ssoSagas$1),
|
|
2971
3240
|
call(ssoSagas),
|
|
2972
3241
|
call(profileSagas),
|
|
2973
3242
|
call(mfaSagas),
|
|
@@ -3010,4 +3279,4 @@ var authStore = {
|
|
|
3010
3279
|
actions,
|
|
3011
3280
|
};
|
|
3012
3281
|
|
|
3013
|
-
export { AcceptInvitationStep, ActivateAccountStep, ApiStateKeys, ForgotPasswordStep, LoginStep, MFAStep, SamlVendors, SignUpStage, TeamStateKeys, actions$d as acceptInvitationActions, reducers$c as acceptInvitationReducers, acceptInvitationState, actions$3 as accountSettingsActions, reducers$2 as accountSettingsReducers, accountSettingsState, actions$e as activateAccountActions, reducers$d as activateAccountReducers, activateState, actions$5 as apiTokensActions, reducers$4 as apiTokensReducers, apiTokensState, actions as authActions, initialState as authInitialState, mockSagas as authMockSagas, reducer as authReducers, sagas as authSagas, authStore as default, actions$c as forgotPasswordActions, reducers$b as forgotPasswordReducers, forgotPasswordState, actions$f as loginActions, reducers$e as loginReducers, loginState, actions$9 as mfaActions, reducers$8 as mfaReducers, mfaState, actions$a as profileActions, reducers$9 as profileReducers, profileState, actions$1 as rolesActions, reducers as rolesReducers, rolesState, actions$4 as securityPolicyActions, reducers$3 as securityPolicyReducers, securityPolicyState, actions$6 as signUpActions, reducers$5 as signUpReducers, signUpState, socialLoginState, actions$7 as socialLoginsActions, reducers$6 as socialLoginsReducer, actions$b as ssoActions, reducers$a as ssoReducers, ssoState, actions$8 as teamActions, reducers$7 as teamReducers, teamState, actions$2 as tenantsActions, reducers$1 as tenantsReducers, tenantsState };
|
|
3282
|
+
export { AcceptInvitationStep, ActivateAccountStep, ApiStateKeys, ForgotPasswordStep, LoginStep, MFAStep, SSOStateKeys, SamlVendors, SignUpStage, TeamStateKeys, actions$d as acceptInvitationActions, reducers$c as acceptInvitationReducers, acceptInvitationState, actions$3 as accountSettingsActions, reducers$2 as accountSettingsReducers, accountSettingsState, actions$e as activateAccountActions, reducers$d as activateAccountReducers, activateState, actions$5 as apiTokensActions, reducers$4 as apiTokensReducers, apiTokensState, actions as authActions, initialState as authInitialState, mockSagas as authMockSagas, reducer as authReducers, sagas as authSagas, authStore as default, actions$c as forgotPasswordActions, reducers$b as forgotPasswordReducers, forgotPasswordState, actions$f as loginActions, reducers$e as loginReducers, loginState, actions$9 as mfaActions, reducers$8 as mfaReducers, mfaState, actions$a as profileActions, reducers$9 as profileReducers, profileState, actions$1 as rolesActions, reducers as rolesReducers, rolesState, actions$4 as securityPolicyActions, reducers$3 as securityPolicyReducers, securityPolicyState, actions$6 as signUpActions, reducers$5 as signUpReducers, signUpState, socialLoginState, actions$7 as socialLoginsActions, reducers$6 as socialLoginsReducer, actions$b as ssoActions, reducers$a as ssoReducers, ssoState, actions$8 as teamActions, reducers$7 as teamReducers, teamState, actions$2 as tenantsActions, reducers$1 as tenantsReducers, tenantsState };
|
package/auth/reducer.d.ts
CHANGED
|
@@ -96,11 +96,70 @@ declare const actions: {
|
|
|
96
96
|
verifyMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IVerifyMfa, string | undefined>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IVerifyMfa, string | undefined>, string, never, never>;
|
|
97
97
|
verifyMfaAfterForce: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, string | undefined>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, string | undefined>, string, never, never>;
|
|
98
98
|
disableMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IDisableMfa, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IDisableMfa, boolean>, string, never, never>;
|
|
99
|
+
loadSSOConfigurationsV2: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
100
|
+
saveSSOConfigurationV2: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<Partial<Pick<import("@frontegg/rest-api").ISSOConfiguration, "roleIds" | "enabled" | "generatedVerification" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "spEntityId" | "oidcClientId" | "oidcSecret" | "type" | "groups">>, import("@frontegg/rest-api").ISSOConfiguration>], import("../interfaces").WithCallback<Partial<Pick<import("@frontegg/rest-api").ISSOConfiguration, "roleIds" | "enabled" | "generatedVerification" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "spEntityId" | "oidcClientId" | "oidcSecret" | "type" | "groups">>, import("@frontegg/rest-api").ISSOConfiguration>, string, never, never>;
|
|
101
|
+
updateSSOConfiguration: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<Partial<Pick<import("@frontegg/rest-api").ISSOConfiguration, "roleIds" | "enabled" | "generatedVerification" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "spEntityId" | "oidcClientId" | "oidcSecret" | "type" | "groups">> & {
|
|
102
|
+
ssoConfigId: string;
|
|
103
|
+
}, import("@frontegg/rest-api").ISSOConfiguration>], import("../interfaces").WithCallback<Partial<Pick<import("@frontegg/rest-api").ISSOConfiguration, "roleIds" | "enabled" | "generatedVerification" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "spEntityId" | "oidcClientId" | "oidcSecret" | "type" | "groups">> & {
|
|
104
|
+
ssoConfigId: string;
|
|
105
|
+
}, import("@frontegg/rest-api").ISSOConfiguration>, string, never, never>;
|
|
106
|
+
deleteSSOConfiguration: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<{
|
|
107
|
+
ssoConfigId: string;
|
|
108
|
+
}, boolean>], import("../interfaces").WithCallback<{
|
|
109
|
+
ssoConfigId: string;
|
|
110
|
+
}, boolean>, string, never, never>;
|
|
111
|
+
saveSSODomain: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ICreateSSODomain & {
|
|
112
|
+
ssoConfigId: string;
|
|
113
|
+
}, import("@frontegg/rest-api").ISSODomain>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ICreateSSODomain & {
|
|
114
|
+
ssoConfigId: string;
|
|
115
|
+
}, import("@frontegg/rest-api").ISSODomain>, string, never, never>;
|
|
116
|
+
deleteSSODomain: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<{
|
|
117
|
+
domainId: string;
|
|
118
|
+
ssoConfigId: string;
|
|
119
|
+
}, boolean>], import("../interfaces").WithCallback<{
|
|
120
|
+
domainId: string;
|
|
121
|
+
ssoConfigId: string;
|
|
122
|
+
}, boolean>, string, never, never>;
|
|
123
|
+
validateSSODomainV2: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<{
|
|
124
|
+
domainId: string;
|
|
125
|
+
ssoConfigId: string;
|
|
126
|
+
}, boolean>], import("../interfaces").WithCallback<{
|
|
127
|
+
domainId: string;
|
|
128
|
+
ssoConfigId: string;
|
|
129
|
+
}, boolean>, string, never, never>;
|
|
130
|
+
setSSODefaultRoles: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<{
|
|
131
|
+
roleIds: string[];
|
|
132
|
+
ssoConfigId: string;
|
|
133
|
+
}, boolean>], import("../interfaces").WithCallback<{
|
|
134
|
+
roleIds: string[];
|
|
135
|
+
ssoConfigId: string;
|
|
136
|
+
}, boolean>, string, never, never>;
|
|
137
|
+
setSSOGroups: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<{
|
|
138
|
+
ssoConfigId: string;
|
|
139
|
+
groupsToAdd: import("@frontegg/rest-api").ICreateSamlGroup[];
|
|
140
|
+
groupsToDelete: string[];
|
|
141
|
+
}, boolean>], import("../interfaces").WithCallback<{
|
|
142
|
+
ssoConfigId: string;
|
|
143
|
+
groupsToAdd: import("@frontegg/rest-api").ICreateSamlGroup[];
|
|
144
|
+
groupsToDelete: string[];
|
|
145
|
+
}, boolean>, string, never, never>;
|
|
146
|
+
saveSSOConfigurationByMetadata: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<{
|
|
147
|
+
configFile: File;
|
|
148
|
+
}, import("@frontegg/rest-api").ISSOConfiguration>], import("../interfaces").WithCallback<{
|
|
149
|
+
configFile: File;
|
|
150
|
+
}, import("@frontegg/rest-api").ISSOConfiguration>, string, never, never>;
|
|
151
|
+
updateSSOConfigurationByMetadata: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<{
|
|
152
|
+
configFile: File;
|
|
153
|
+
ssoConfigId: string;
|
|
154
|
+
}, import("@frontegg/rest-api").ISSOConfiguration>], import("../interfaces").WithCallback<{
|
|
155
|
+
configFile: File;
|
|
156
|
+
ssoConfigId: string;
|
|
157
|
+
}, import("@frontegg/rest-api").ISSOConfiguration>, string, never, never>;
|
|
99
158
|
loadSSOConfigurations: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
100
159
|
loadSSOAuthorizationRoles: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
101
|
-
saveSSOConfigurations: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<Partial<import("@frontegg/rest-api").ISamlConfiguration & {
|
|
160
|
+
saveSSOConfigurations: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<Partial<Pick<import("@frontegg/rest-api").ISamlConfiguration, "enabled" | "domain" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "spEntityId" | "isSamlActive" | "oidcClientId" | "oidcSecret" | "type"> & {
|
|
102
161
|
samlVendor: import(".").SamlVendors;
|
|
103
|
-
}>, boolean>], import("../interfaces").WithCallback<Partial<import("@frontegg/rest-api").ISamlConfiguration & {
|
|
162
|
+
}>, boolean>], import("../interfaces").WithCallback<Partial<Pick<import("@frontegg/rest-api").ISamlConfiguration, "enabled" | "domain" | "ssoEndpoint" | "publicCertificate" | "signRequest" | "acsUrl" | "spEntityId" | "isSamlActive" | "oidcClientId" | "oidcSecret" | "type"> & {
|
|
104
163
|
samlVendor: import(".").SamlVendors;
|
|
105
164
|
}>, boolean>, string, never, never>;
|
|
106
165
|
saveSSOConfigurationsFile: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[File[]], File[], string, never, never>;
|
|
@@ -219,6 +278,8 @@ declare const actions: {
|
|
|
219
278
|
resetTeamState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
220
279
|
setMfaState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import(".").MFAState>], Partial<import(".").MFAState>, string, never, never>;
|
|
221
280
|
resetMfaState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
281
|
+
setSSOLoader: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").SSOStateIndicator], import(".").SSOStateIndicator, string, never, never>;
|
|
282
|
+
setSSOError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").SSOStateIndicator], import(".").SSOStateIndicator, string, never, never>;
|
|
222
283
|
setSSOState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import(".").SSOState>], Partial<import(".").SSOState>, string, never, never>;
|
|
223
284
|
resetSSOState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
224
285
|
setProfileState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import(".").ProfileState>], Partial<import(".").ProfileState>, string, never, never>;
|
package/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function omitProps<T>(props: any, keys: string[]): T;
|
|
2
2
|
export declare function generateActionCreator(storeName: string): <Payload>(key: string, withPayload?: boolean | undefined) => import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Payload], Payload, string, never, never> | import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
3
|
-
export declare function generateCodeChallenge(codeVerifier:
|
|
3
|
+
export declare function generateCodeChallenge(codeVerifier: string): Promise<string>;
|
|
4
4
|
export declare function createRandomString(length?: number): string;
|
|
5
5
|
export declare const readFileAsText: (file: File) => Promise<string>;
|
package/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { AuditsState } from './audits/interfaces';
|
|
|
4
4
|
import { IConnectivityState } from './connectivity/interfaces';
|
|
5
5
|
import { SubscriptionsState } from './subscriptions/interfaces';
|
|
6
6
|
import { VendorState } from './vendor/interfaces';
|
|
7
|
+
import { OldAuditsState } from './audits/backward-compatibility';
|
|
7
8
|
export { default as auth } from './auth';
|
|
8
9
|
export { default as audits } from './audits';
|
|
9
10
|
export { default as connectivity } from './connectivity';
|
|
@@ -19,7 +20,8 @@ export * from './toolkit';
|
|
|
19
20
|
export declare type FronteggState = {
|
|
20
21
|
root: RootState;
|
|
21
22
|
auth: AuthState;
|
|
22
|
-
|
|
23
|
+
auditLogs: AuditsState;
|
|
24
|
+
audits: OldAuditsState;
|
|
23
25
|
connectivity: IConnectivityState;
|
|
24
26
|
subscriptions: SubscriptionsState;
|
|
25
27
|
vendor: VendorState;
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AcceptInvitationStep, ActivateAccountStep, ApiStateKeys, ForgotPasswordStep, LoginStep, MFAStep, SamlVendors, SignUpStage, TeamStateKeys, acceptInvitationActions, acceptInvitationReducers, acceptInvitationState, accountSettingsActions, accountSettingsReducers, accountSettingsState, activateAccountActions, activateAccountReducers, activateState, apiTokensActions, apiTokensReducers, apiTokensState, default as auth, authActions, authInitialState, authMockSagas, authReducers, authSagas, forgotPasswordActions, forgotPasswordReducers, forgotPasswordState, loginActions, loginReducers, loginState, mfaActions, mfaReducers, mfaState, profileActions, profileReducers, profileState, rolesActions, rolesReducers, rolesState, securityPolicyActions, securityPolicyReducers, securityPolicyState, signUpActions, signUpReducers, signUpState, socialLoginState, socialLoginsActions, socialLoginsReducer, ssoActions, ssoReducers, ssoState, teamActions, teamReducers, teamState, tenantsActions, tenantsReducers, tenantsState } from './auth/index.js';
|
|
1
|
+
export { AcceptInvitationStep, ActivateAccountStep, ApiStateKeys, ForgotPasswordStep, LoginStep, MFAStep, SSOStateKeys, SamlVendors, SignUpStage, TeamStateKeys, acceptInvitationActions, acceptInvitationReducers, acceptInvitationState, accountSettingsActions, accountSettingsReducers, accountSettingsState, activateAccountActions, activateAccountReducers, activateState, apiTokensActions, apiTokensReducers, apiTokensState, default as auth, authActions, authInitialState, authMockSagas, authReducers, authSagas, forgotPasswordActions, forgotPasswordReducers, forgotPasswordState, loginActions, loginReducers, loginState, mfaActions, mfaReducers, mfaState, profileActions, profileReducers, profileState, rolesActions, rolesReducers, rolesState, securityPolicyActions, securityPolicyReducers, securityPolicyState, signUpActions, signUpReducers, signUpState, socialLoginState, socialLoginsActions, socialLoginsReducer, ssoActions, ssoReducers, ssoState, teamActions, teamReducers, teamState, tenantsActions, tenantsReducers, tenantsState } from './auth/index.js';
|
|
2
2
|
export { auditLogsActions, auditLogsReducers, auditLogsState, default as audits, auditsActions, auditsInitialState, auditsMetadataActions, auditsMetadataReducers, auditsMetadataState, auditsMockSagas, auditsReducers, auditsSagas } from './audits/index.js';
|
|
3
3
|
export { default as connectivity, connectivityActions, connectivityInitialState, connectivityReducers, connectivitySagas } from './connectivity/index.js';
|
|
4
4
|
export { CheckoutEvent, CheckoutStatus, PaymentMethodType, PaymentProvider, SubscriptionCancellationPolicy, SubscriptionStatus, subscriptionActions, subscriptionInitialState, subscriptionReducers, subscriptionSagas, subscriptionSagasMock, default as subscriptions } from './subscriptions/index.js';
|
package/node/auth/index.js
CHANGED
|
@@ -161,12 +161,28 @@ const ssoState = {
|
|
|
161
161
|
firstLoad: true,
|
|
162
162
|
loading: true,
|
|
163
163
|
saving: false,
|
|
164
|
+
errors: {},
|
|
165
|
+
loaders: {},
|
|
166
|
+
ssoConfigurations: []
|
|
164
167
|
};
|
|
165
168
|
const reducers$a = {
|
|
169
|
+
setSSOLoader: loadersReducerForKey('ssoState'),
|
|
170
|
+
setSSOError: errorsReducerForKey('ssoState'),
|
|
166
171
|
setSSOState: typeReducerForKey('ssoState'),
|
|
167
172
|
resetSSOState: resetStateByKey('ssoState', { ssoState }),
|
|
168
173
|
};
|
|
169
174
|
const actions$b = {
|
|
175
|
+
loadSSOConfigurationsV2: toolkit.createAction(`${constants.authStoreName}/loadSSOConfigurationsV2`),
|
|
176
|
+
saveSSOConfigurationV2: toolkit.createAction(`${constants.authStoreName}/saveSSOConfigurationV2`, (payload) => ({ payload })),
|
|
177
|
+
updateSSOConfiguration: toolkit.createAction(`${constants.authStoreName}/updateSSOConfiguration`, (payload) => ({ payload })),
|
|
178
|
+
deleteSSOConfiguration: toolkit.createAction(`${constants.authStoreName}/deleteSSOConfiguration`, (payload) => ({ payload })),
|
|
179
|
+
saveSSODomain: toolkit.createAction(`${constants.authStoreName}/saveSSODomain`, (payload) => ({ payload })),
|
|
180
|
+
deleteSSODomain: toolkit.createAction(`${constants.authStoreName}/deleteSSODomain`, (payload) => ({ payload })),
|
|
181
|
+
validateSSODomainV2: toolkit.createAction(`${constants.authStoreName}/validateSSODomainV2`, (payload) => ({ payload })),
|
|
182
|
+
setSSODefaultRoles: toolkit.createAction(`${constants.authStoreName}/setSSODefaultRoles`, (payload) => ({ payload })),
|
|
183
|
+
setSSOGroups: toolkit.createAction(`${constants.authStoreName}/setSSOGroups`, (payload) => ({ payload })),
|
|
184
|
+
saveSSOConfigurationByMetadata: toolkit.createAction(`${constants.authStoreName}/saveSSOConfigurationByMetadata`, (payload) => ({ payload })),
|
|
185
|
+
updateSSOConfigurationByMetadata: toolkit.createAction(`${constants.authStoreName}/updateSSOConfigurationByMetadata`, (payload) => ({ payload })),
|
|
170
186
|
loadSSOConfigurations: toolkit.createAction(`${constants.authStoreName}/loadSSOConfigurations`),
|
|
171
187
|
loadSSOAuthorizationRoles: toolkit.createAction(`${constants.authStoreName}/loadSSOAuthorizationRoles`),
|
|
172
188
|
saveSSOConfigurations: toolkit.createAction(`${constants.authStoreName}/saveSSOConfigurations`, (payload) => ({ payload })),
|
|
@@ -494,6 +510,22 @@ const { reducer, actions: sliceActions } = toolkit.createSlice({
|
|
|
494
510
|
});
|
|
495
511
|
const actions = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sliceActions), actions$f), actions$7), actions$e), actions$d), actions$c), actions$6), actions$a), actions$b), actions$9), actions$8), actions$5), actions$4), actions$3), actions$2), actions$1);
|
|
496
512
|
|
|
513
|
+
exports.SSOStateKeys = void 0;
|
|
514
|
+
(function (SSOStateKeys) {
|
|
515
|
+
SSOStateKeys["LOAD_SSO_CONFIGURATIONS"] = "LOAD_SSO_CONFIGURATIONS";
|
|
516
|
+
SSOStateKeys["SAVE_SSO_CONFIGURATION"] = "SAVE_SSO_CONFIGURATION";
|
|
517
|
+
SSOStateKeys["UPDATE_SSO_CONFIGURATION"] = "UPDATE_SSO_CONFIGURATION";
|
|
518
|
+
SSOStateKeys["SAVE_SSO_CONFIGURATION_BY_METADATA"] = "SAVE_SSO_CONFIGURATION_BY_METADATA";
|
|
519
|
+
SSOStateKeys["UPDATE_SSO_CONFIGURATION_BY_METADATA"] = "UPDATE_SSO_CONFIGURATION";
|
|
520
|
+
SSOStateKeys["DELETE_SSO_CONFIGURATION"] = "DELETE_SSO_CONFIGURATION";
|
|
521
|
+
SSOStateKeys["SAVE_SSO_DOMAIN"] = "SAVE_SSO_DOMAIN";
|
|
522
|
+
SSOStateKeys["DELETE_SSO_DOMAIN"] = "DELETE_SSO_DOMAIN";
|
|
523
|
+
SSOStateKeys["VALIDATE_SSO_DOMAIN"] = "VALIDATE_SSO_DOMAIN";
|
|
524
|
+
SSOStateKeys["UPDATE_SSO_DEFAULT_ROLES"] = "UPDATE_SSO_DEFAULT_ROLES";
|
|
525
|
+
SSOStateKeys["DELETE_SSO_GROUPS"] = "DELETE_SSO_GROUPS";
|
|
526
|
+
SSOStateKeys["SAVE_SSO_GROUPS"] = "SAVE_SSO_GROUPS";
|
|
527
|
+
SSOStateKeys["GET_SSO_AUTHORIZATION_ROLES"] = "GET_SSO_AUTHORIZATION_ROLES";
|
|
528
|
+
})(exports.SSOStateKeys || (exports.SSOStateKeys = {}));
|
|
497
529
|
exports.SamlVendors = void 0;
|
|
498
530
|
(function (SamlVendors) {
|
|
499
531
|
SamlVendors["Saml"] = "saml";
|
|
@@ -680,6 +712,9 @@ const ssoStateDemo = {
|
|
|
680
712
|
samlConfiguration: samlConfigurationDemo,
|
|
681
713
|
roles: rolesDemo,
|
|
682
714
|
authorizationRoles: [],
|
|
715
|
+
errors: {},
|
|
716
|
+
loaders: {},
|
|
717
|
+
ssoConfigurations: [],
|
|
683
718
|
};
|
|
684
719
|
const permissionsDemo = [
|
|
685
720
|
{
|
|
@@ -1051,6 +1086,7 @@ const isMfaRequired = (user) => {
|
|
|
1051
1086
|
function* getMfaRequiredState(user) {
|
|
1052
1087
|
let setMfaState = {};
|
|
1053
1088
|
let step = exports.LoginStep.loginWithTwoFactor;
|
|
1089
|
+
const { loginState } = yield effects.select((state) => state.auth);
|
|
1054
1090
|
const { isAllowedToRemember, mfaDeviceExpiration } = yield effects.call(restApi.api.auth.checkIfAllowToRememberMfaDevice, user.mfaToken);
|
|
1055
1091
|
if (user.hasOwnProperty('mfaEnrolled') && !user.mfaEnrolled) {
|
|
1056
1092
|
setMfaState = {
|
|
@@ -1064,17 +1100,7 @@ function* getMfaRequiredState(user) {
|
|
|
1064
1100
|
};
|
|
1065
1101
|
step = exports.LoginStep.forceTwoFactor;
|
|
1066
1102
|
}
|
|
1067
|
-
return Object.assign(Object.assign({ user: undefined, isAuthenticated: false }, setMfaState), { loginState: {
|
|
1068
|
-
mfaToken: user.mfaToken,
|
|
1069
|
-
mfaRequired: user.mfaRequired,
|
|
1070
|
-
loading: false,
|
|
1071
|
-
error: undefined,
|
|
1072
|
-
step,
|
|
1073
|
-
tenantsLoading: true,
|
|
1074
|
-
tenants: [],
|
|
1075
|
-
allowRememberMfaDevice: isAllowedToRemember,
|
|
1076
|
-
mfaDeviceExpiration,
|
|
1077
|
-
} });
|
|
1103
|
+
return Object.assign(Object.assign({ user: undefined, isAuthenticated: false }, setMfaState), { loginState: Object.assign(Object.assign({}, loginState), { mfaToken: user.mfaToken, mfaRequired: user.mfaRequired, loading: false, error: undefined, step, tenantsLoading: true, tenants: [], allowRememberMfaDevice: isAllowedToRemember, mfaDeviceExpiration }) });
|
|
1078
1104
|
}
|
|
1079
1105
|
function* refreshToken() {
|
|
1080
1106
|
try {
|
|
@@ -1089,7 +1115,7 @@ function* refreshToken() {
|
|
|
1089
1115
|
else {
|
|
1090
1116
|
yield effects.put(actions.loadTenants());
|
|
1091
1117
|
yield effects.put(actions.setState({ user, isAuthenticated: true }));
|
|
1092
|
-
if ([routes.loginUrl, routes.socialLoginCallbackUrl, routes.signUpUrl, routes.oidcRedirectUrl].
|
|
1118
|
+
if ([routes.loginUrl, routes.socialLoginCallbackUrl, routes.signUpUrl, routes.oidcRedirectUrl].some(url => url && window.location.pathname.endsWith(url)) ||
|
|
1093
1119
|
(window.location.pathname.endsWith(routes.activateUrl) && user.verified)) {
|
|
1094
1120
|
if (loginState.isNewUser && routes.signUpSuccessUrl && routes.socialLoginCallbackUrl === window.location.pathname) {
|
|
1095
1121
|
onRedirectTo(routes.signUpSuccessUrl, { refresh: routes.signUpSuccessUrl.startsWith('http') });
|
|
@@ -1221,7 +1247,7 @@ function* preLogin({ payload: { email, recaptchaToken, callback } }) {
|
|
|
1221
1247
|
yield effects.put(actions.setLoginState({ loading: true }));
|
|
1222
1248
|
try {
|
|
1223
1249
|
const onRedirectTo = yield effects.select(({ auth: { onRedirectTo } }) => onRedirectTo);
|
|
1224
|
-
let { address, idpType } = yield effects.call(restApi.api.auth.
|
|
1250
|
+
let { address, idpType } = yield effects.call(restApi.api.auth.preLoginV2, { email });
|
|
1225
1251
|
if (address) {
|
|
1226
1252
|
if (idpType === exports.SamlVendors.Oidc && !address.includes('redirect_uri')) {
|
|
1227
1253
|
const { routes: { oidcRedirectUrl } } = yield effects.select(({ auth: { routes } }) => ({ routes }));
|
|
@@ -1615,9 +1641,10 @@ function* createSamlGroupFunction({ payload: { group, roleIds, callback } }) {
|
|
|
1615
1641
|
}
|
|
1616
1642
|
function* oidcPostloginFunction({ payload }) {
|
|
1617
1643
|
var _a;
|
|
1644
|
+
const data = { code: payload.code, redirectUri: payload.redirectUri, RelayState: payload.state };
|
|
1618
1645
|
try {
|
|
1619
1646
|
yield effects.put(actions.setSSOState({ loading: true }));
|
|
1620
|
-
yield effects.call(restApi.api.auth.
|
|
1647
|
+
yield effects.call(restApi.api.auth.oidcPostLoginV2, data);
|
|
1621
1648
|
yield refreshToken();
|
|
1622
1649
|
yield effects.put(actions.setSSOState({ loading: false }));
|
|
1623
1650
|
}
|
|
@@ -1625,7 +1652,7 @@ function* oidcPostloginFunction({ payload }) {
|
|
|
1625
1652
|
yield effects.put(actions.setSSOState({ loading: false, error: (_a = e.message) !== null && _a !== void 0 ? _a : 'Failed to authenticate', firstLoad: false }));
|
|
1626
1653
|
}
|
|
1627
1654
|
}
|
|
1628
|
-
function* ssoSagas() {
|
|
1655
|
+
function* ssoSagas$1() {
|
|
1629
1656
|
yield effects.takeEvery(actions.loadSSOConfigurations, loadSSOConfigurations);
|
|
1630
1657
|
yield effects.takeEvery(actions.saveSSOConfigurations, saveSSOConfigurations);
|
|
1631
1658
|
yield effects.takeEvery(actions.saveSSOConfigurationsFile, saveSSOConfigurationsFile);
|
|
@@ -1722,6 +1749,247 @@ function* ssoSagasMock() {
|
|
|
1722
1749
|
yield effects.takeEvery(actions.updateSSOAuthorizationRoles, updateAuthorizationRolesMock);
|
|
1723
1750
|
}
|
|
1724
1751
|
|
|
1752
|
+
function* loadConfigs() {
|
|
1753
|
+
const ssoConfigurations = yield effects.call(restApi.api.auth.getSSOConfigurations);
|
|
1754
|
+
const oidcConfiguration = yield effects.call(restApi.api.auth.getOidcConfiguration);
|
|
1755
|
+
const samlMetadata = yield effects.call(restApi.api.metadata.getSamlMetadata);
|
|
1756
|
+
yield effects.put(actions.setSSOState({
|
|
1757
|
+
ssoConfigurations,
|
|
1758
|
+
oidcConfiguration,
|
|
1759
|
+
samlMetadata
|
|
1760
|
+
}));
|
|
1761
|
+
}
|
|
1762
|
+
function* loadSSOConfigurationsV2() {
|
|
1763
|
+
try {
|
|
1764
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.LOAD_SSO_CONFIGURATIONS, value: true }));
|
|
1765
|
+
yield loadConfigs();
|
|
1766
|
+
}
|
|
1767
|
+
catch (error) {
|
|
1768
|
+
yield effects.put(actions.setSSOError({ key: exports.SSOStateKeys.LOAD_SSO_CONFIGURATIONS, value: error.message }));
|
|
1769
|
+
}
|
|
1770
|
+
finally {
|
|
1771
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.LOAD_SSO_CONFIGURATIONS, value: false }));
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
function* saveSSOConfigurationV2({ payload }) {
|
|
1775
|
+
var _a;
|
|
1776
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.SAVE_SSO_CONFIGURATION, value: true }));
|
|
1777
|
+
const { callback } = payload, ssoConfiguration = tslib.__rest(payload, ["callback"]);
|
|
1778
|
+
const ssoConfigurations = yield effects.select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1779
|
+
try {
|
|
1780
|
+
const newSsoConfiguration = yield effects.call(restApi.api.auth.createSSOConfiguration, Object.assign(Object.assign({}, ssoConfiguration), { enabled: (_a = ssoConfiguration.enabled) !== null && _a !== void 0 ? _a : false }));
|
|
1781
|
+
yield effects.put(actions.setSSOState({ ssoConfigurations: [...ssoConfigurations, newSsoConfiguration] }));
|
|
1782
|
+
callback === null || callback === void 0 ? void 0 : callback(newSsoConfiguration);
|
|
1783
|
+
}
|
|
1784
|
+
catch (error) {
|
|
1785
|
+
yield effects.put(actions.setSSOError({ key: exports.SSOStateKeys.SAVE_SSO_CONFIGURATION, value: error.message }));
|
|
1786
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1787
|
+
}
|
|
1788
|
+
finally {
|
|
1789
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.SAVE_SSO_CONFIGURATION, value: false }));
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
function* saveSSOConfigurationByMetadata({ payload }) {
|
|
1793
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.SAVE_SSO_CONFIGURATION_BY_METADATA, value: true }));
|
|
1794
|
+
const { configFile, callback } = payload;
|
|
1795
|
+
const ssoConfigurations = yield effects.select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1796
|
+
try {
|
|
1797
|
+
const metadata = yield readFileAsText(configFile);
|
|
1798
|
+
const newSsoConfiguration = yield effects.call(restApi.api.auth.createSSOConfigurationByMetadata, { metadata });
|
|
1799
|
+
yield effects.put(actions.setSSOState({ ssoConfigurations: [...ssoConfigurations, newSsoConfiguration] }));
|
|
1800
|
+
callback === null || callback === void 0 ? void 0 : callback(newSsoConfiguration);
|
|
1801
|
+
}
|
|
1802
|
+
catch (error) {
|
|
1803
|
+
yield effects.put(actions.setSSOError({ key: exports.SSOStateKeys.SAVE_SSO_CONFIGURATION_BY_METADATA, value: error.message }));
|
|
1804
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1805
|
+
}
|
|
1806
|
+
finally {
|
|
1807
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.SAVE_SSO_CONFIGURATION_BY_METADATA, value: false }));
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
function* updateSSOConfiguration({ payload }) {
|
|
1811
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.UPDATE_SSO_CONFIGURATION, value: true }));
|
|
1812
|
+
const { callback, ssoConfigId } = payload, ssoConfiguration = tslib.__rest(payload, ["callback", "ssoConfigId"]);
|
|
1813
|
+
const ssoConfigurations = yield effects.select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1814
|
+
try {
|
|
1815
|
+
const newSsoConfiguration = yield effects.call(restApi.api.auth.updateSSOConfiguration, ssoConfigId, ssoConfiguration);
|
|
1816
|
+
const newSsoConfigurations = ssoConfigurations.map((ssoConfig) => ssoConfig.id === ssoConfigId ? newSsoConfiguration : ssoConfig);
|
|
1817
|
+
yield effects.put(actions.setSSOState({ ssoConfigurations: newSsoConfigurations }));
|
|
1818
|
+
callback === null || callback === void 0 ? void 0 : callback(newSsoConfiguration);
|
|
1819
|
+
}
|
|
1820
|
+
catch (error) {
|
|
1821
|
+
yield effects.put(actions.setSSOError({ key: exports.SSOStateKeys.UPDATE_SSO_CONFIGURATION, value: error.message }));
|
|
1822
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1823
|
+
}
|
|
1824
|
+
finally {
|
|
1825
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.UPDATE_SSO_CONFIGURATION, value: false }));
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
function* updateSSOConfigurationByMetadata({ payload }) {
|
|
1829
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.UPDATE_SSO_CONFIGURATION_BY_METADATA, value: true }));
|
|
1830
|
+
const { callback, ssoConfigId, configFile } = payload;
|
|
1831
|
+
const ssoConfigurations = yield effects.select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1832
|
+
try {
|
|
1833
|
+
const metadata = yield readFileAsText(configFile);
|
|
1834
|
+
const newSsoConfiguration = yield effects.call(restApi.api.auth.updateSSOConfigurationByMetadata, ssoConfigId, { metadata });
|
|
1835
|
+
const newSsoConfigurations = ssoConfigurations.map((ssoConfig) => ssoConfig.id === ssoConfigId ? newSsoConfiguration : ssoConfig);
|
|
1836
|
+
yield effects.put(actions.setSSOState({ ssoConfigurations: newSsoConfigurations }));
|
|
1837
|
+
callback === null || callback === void 0 ? void 0 : callback(newSsoConfiguration);
|
|
1838
|
+
}
|
|
1839
|
+
catch (error) {
|
|
1840
|
+
yield effects.put(actions.setSSOError({ key: exports.SSOStateKeys.UPDATE_SSO_CONFIGURATION, value: error.message }));
|
|
1841
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1842
|
+
}
|
|
1843
|
+
finally {
|
|
1844
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.UPDATE_SSO_CONFIGURATION, value: false }));
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
function* deleteSSOConfiguration({ payload }) {
|
|
1848
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.DELETE_SSO_CONFIGURATION, value: true }));
|
|
1849
|
+
const { ssoConfigId, callback } = payload;
|
|
1850
|
+
const ssoConfigurations = yield effects.select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1851
|
+
try {
|
|
1852
|
+
yield effects.call(restApi.api.auth.deleteSSOConfiguration, ssoConfigId);
|
|
1853
|
+
yield effects.put(actions.setSSOState({ ssoConfigurations: ssoConfigurations.filter(({ id }) => id !== ssoConfigId) }));
|
|
1854
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1855
|
+
}
|
|
1856
|
+
catch (error) {
|
|
1857
|
+
yield effects.put(actions.setSSOError({ key: exports.SSOStateKeys.DELETE_SSO_CONFIGURATION, value: error.message }));
|
|
1858
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1859
|
+
}
|
|
1860
|
+
finally {
|
|
1861
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.DELETE_SSO_CONFIGURATION, value: false }));
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
function* saveSSODomain({ payload }) {
|
|
1865
|
+
const { callback, ssoConfigId } = payload, body = tslib.__rest(payload, ["callback", "ssoConfigId"]);
|
|
1866
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.SAVE_SSO_DOMAIN, value: true }));
|
|
1867
|
+
const ssoConfigurations = yield effects.select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1868
|
+
try {
|
|
1869
|
+
const domain = yield effects.call(restApi.api.auth.createSSODomain, ssoConfigId, body);
|
|
1870
|
+
const newSsoConfigurations = ssoConfigurations.map((ssoConfig) => {
|
|
1871
|
+
if (ssoConfig.id === ssoConfigId) {
|
|
1872
|
+
return Object.assign(Object.assign({}, ssoConfig), { domains: [...ssoConfig.domains, domain] });
|
|
1873
|
+
}
|
|
1874
|
+
return ssoConfig;
|
|
1875
|
+
});
|
|
1876
|
+
yield effects.put(actions.setSSOState({ ssoConfigurations: newSsoConfigurations }));
|
|
1877
|
+
callback === null || callback === void 0 ? void 0 : callback(domain);
|
|
1878
|
+
}
|
|
1879
|
+
catch (error) {
|
|
1880
|
+
yield effects.put(actions.setSSOError({ key: exports.SSOStateKeys.SAVE_SSO_DOMAIN, value: error.message }));
|
|
1881
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1882
|
+
}
|
|
1883
|
+
finally {
|
|
1884
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.SAVE_SSO_DOMAIN, value: false }));
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
function* deleteSSODomain({ payload }) {
|
|
1888
|
+
const { ssoConfigId, domainId, callback } = payload;
|
|
1889
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.DELETE_SSO_DOMAIN, value: true }));
|
|
1890
|
+
const ssoConfigurations = yield effects.select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1891
|
+
try {
|
|
1892
|
+
yield effects.call(restApi.api.auth.deleteSSODomain, ssoConfigId, domainId);
|
|
1893
|
+
const newSsoConfigurations = ssoConfigurations.map((ssoConfig) => {
|
|
1894
|
+
if (ssoConfig.id === ssoConfigId) {
|
|
1895
|
+
return Object.assign(Object.assign({}, ssoConfig), { domains: ssoConfig.domains.filter(({ id }) => id !== domainId) });
|
|
1896
|
+
}
|
|
1897
|
+
return ssoConfig;
|
|
1898
|
+
});
|
|
1899
|
+
yield effects.put(actions.setSSOState({ ssoConfigurations: newSsoConfigurations }));
|
|
1900
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1901
|
+
}
|
|
1902
|
+
catch (error) {
|
|
1903
|
+
yield effects.put(actions.setSSOError({ key: exports.SSOStateKeys.DELETE_SSO_DOMAIN, value: error.message }));
|
|
1904
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1905
|
+
}
|
|
1906
|
+
finally {
|
|
1907
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.DELETE_SSO_DOMAIN, value: false }));
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
function* validateSSODomainV2({ payload }) {
|
|
1911
|
+
const { callback, domainId, ssoConfigId } = payload;
|
|
1912
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.VALIDATE_SSO_DOMAIN, value: true }));
|
|
1913
|
+
const ssoConfigurations = yield effects.select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1914
|
+
try {
|
|
1915
|
+
yield effects.call(restApi.api.auth.validateSSODomain, ssoConfigId, domainId);
|
|
1916
|
+
const newSsoConfigurations = ssoConfigurations.map((ssoConfig) => {
|
|
1917
|
+
if (ssoConfig.id === ssoConfigId) {
|
|
1918
|
+
return Object.assign(Object.assign({}, ssoConfig), { domains: ssoConfig.domains.map((ssoDomain) => ssoDomain.id === domainId ? Object.assign(Object.assign({}, ssoDomain), { validated: true }) : ssoDomain) });
|
|
1919
|
+
}
|
|
1920
|
+
return ssoConfig;
|
|
1921
|
+
});
|
|
1922
|
+
yield effects.put(actions.setSSOState({ ssoConfigurations: newSsoConfigurations }));
|
|
1923
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1924
|
+
}
|
|
1925
|
+
catch (error) {
|
|
1926
|
+
yield effects.put(actions.setSSOError({ key: exports.SSOStateKeys.VALIDATE_SSO_DOMAIN, value: error.message }));
|
|
1927
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1928
|
+
}
|
|
1929
|
+
finally {
|
|
1930
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.VALIDATE_SSO_DOMAIN, value: false }));
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
function* setSSODefaultRoles({ payload: { callback, ssoConfigId, roleIds }, }) {
|
|
1934
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.UPDATE_SSO_DEFAULT_ROLES, value: true }));
|
|
1935
|
+
const ssoConfigurations = yield effects.select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1936
|
+
try {
|
|
1937
|
+
yield effects.call(restApi.api.auth.setSSODefaultRoles, ssoConfigId, { roleIds });
|
|
1938
|
+
const newSsoConfigurations = ssoConfigurations.map((ssoConfig) => {
|
|
1939
|
+
if (ssoConfig.id === ssoConfigId) {
|
|
1940
|
+
return Object.assign(Object.assign({}, ssoConfig), { roleIds });
|
|
1941
|
+
}
|
|
1942
|
+
return ssoConfig;
|
|
1943
|
+
});
|
|
1944
|
+
yield effects.put(actions.setSSOState({ ssoConfigurations: newSsoConfigurations }));
|
|
1945
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1946
|
+
}
|
|
1947
|
+
catch (error) {
|
|
1948
|
+
yield effects.put(actions.setSSOError({ key: exports.SSOStateKeys.UPDATE_SSO_DEFAULT_ROLES, value: error.message }));
|
|
1949
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1950
|
+
}
|
|
1951
|
+
finally {
|
|
1952
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.UPDATE_SSO_DEFAULT_ROLES, value: false }));
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
function* setSSOGroups({ payload: { groupsToAdd, groupsToDelete, ssoConfigId, callback } }) {
|
|
1956
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.SAVE_SSO_GROUPS, value: true }));
|
|
1957
|
+
const ssoConfigurations = yield effects.select((state) => state.auth.ssoState.ssoConfigurations);
|
|
1958
|
+
try {
|
|
1959
|
+
yield effects.all(groupsToDelete.map((groupId) => effects.call(restApi.api.auth.deleteSSOGroup, ssoConfigId, groupId)));
|
|
1960
|
+
yield effects.all(groupsToAdd.map((group) => effects.call(restApi.api.auth.createSSOGroup, ssoConfigId, group)));
|
|
1961
|
+
const groups = yield effects.call(restApi.api.auth.getSSOGroups, ssoConfigId);
|
|
1962
|
+
const newSsoConfigurations = ssoConfigurations.map((ssoConfig) => {
|
|
1963
|
+
if (ssoConfig.id === ssoConfigId) {
|
|
1964
|
+
return Object.assign(Object.assign({}, ssoConfig), { groups });
|
|
1965
|
+
}
|
|
1966
|
+
return ssoConfig;
|
|
1967
|
+
});
|
|
1968
|
+
yield effects.put(actions.setSSOState({ ssoConfigurations: newSsoConfigurations }));
|
|
1969
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1970
|
+
}
|
|
1971
|
+
catch (error) {
|
|
1972
|
+
yield effects.put(actions.setSSOError({ key: exports.SSOStateKeys.SAVE_SSO_GROUPS, value: error.message }));
|
|
1973
|
+
callback === null || callback === void 0 ? void 0 : callback(null, error);
|
|
1974
|
+
}
|
|
1975
|
+
finally {
|
|
1976
|
+
yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.SAVE_SSO_GROUPS, value: false }));
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
function* ssoSagas() {
|
|
1980
|
+
yield effects.takeEvery(actions.loadSSOConfigurationsV2, loadSSOConfigurationsV2);
|
|
1981
|
+
yield effects.takeEvery(actions.saveSSOConfigurationV2, saveSSOConfigurationV2);
|
|
1982
|
+
yield effects.takeEvery(actions.saveSSODomain, saveSSODomain);
|
|
1983
|
+
yield effects.takeEvery(actions.deleteSSODomain, deleteSSODomain);
|
|
1984
|
+
yield effects.takeEvery(actions.validateSSODomainV2, validateSSODomainV2);
|
|
1985
|
+
yield effects.takeEvery(actions.updateSSOConfiguration, updateSSOConfiguration);
|
|
1986
|
+
yield effects.takeEvery(actions.deleteSSOConfiguration, deleteSSOConfiguration);
|
|
1987
|
+
yield effects.takeEvery(actions.setSSOGroups, setSSOGroups);
|
|
1988
|
+
yield effects.takeEvery(actions.setSSODefaultRoles, setSSODefaultRoles);
|
|
1989
|
+
yield effects.takeEvery(actions.saveSSOConfigurationByMetadata, saveSSOConfigurationByMetadata);
|
|
1990
|
+
yield effects.takeEvery(actions.updateSSOConfigurationByMetadata, updateSSOConfigurationByMetadata);
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1725
1993
|
function* loadProfile() {
|
|
1726
1994
|
yield effects.put(actions.setProfileState({ loading: true }));
|
|
1727
1995
|
try {
|
|
@@ -2970,6 +3238,7 @@ function* sagas() {
|
|
|
2970
3238
|
effects.call(activateSagas),
|
|
2971
3239
|
effects.call(acceptInvitationSagas),
|
|
2972
3240
|
effects.call(forgotPasswordSagas),
|
|
3241
|
+
effects.call(ssoSagas$1),
|
|
2973
3242
|
effects.call(ssoSagas),
|
|
2974
3243
|
effects.call(profileSagas),
|
|
2975
3244
|
effects.call(mfaSagas),
|
package/node/index.js
CHANGED
|
@@ -60,6 +60,12 @@ Object.defineProperty(exports, 'MFAStep', {
|
|
|
60
60
|
return auth_index.MFAStep;
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
+
Object.defineProperty(exports, 'SSOStateKeys', {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function () {
|
|
66
|
+
return auth_index.SSOStateKeys;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
63
69
|
Object.defineProperty(exports, 'SamlVendors', {
|
|
64
70
|
enumerable: true,
|
|
65
71
|
get: function () {
|