@frontegg/rest-api 3.1.76-alpha.9502349697 → 3.1.76-alpha.9762981322
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/ContextHolder/index.d.ts +30 -108
- package/ContextHolder/index.js +57 -153
- package/account-settings/index.d.ts +7 -19
- package/account-settings/index.js +13 -23
- package/applications/index.d.ts +44 -49
- package/applications/index.js +37 -51
- package/audits/index.d.ts +15 -27
- package/audits/index.js +17 -27
- package/auth/index.d.ts +768 -817
- package/auth/index.js +721 -902
- package/auth/secutiry-poilicy/index.d.ts +102 -58
- package/auth/secutiry-poilicy/index.js +90 -122
- package/auth/utils.d.ts +2 -2
- package/auth/utils.js +8 -9
- package/connectivity/index.d.ts +27 -126
- package/connectivity/index.js +114 -147
- package/directory/index.d.ts +22 -31
- package/directory/index.js +15 -27
- package/entitlements/index.d.ts +8 -14
- package/entitlements/index.js +4 -12
- package/feature-flags/index.d.ts +2 -8
- package/feature-flags/index.js +8 -16
- package/fetch.d.ts +24 -0
- package/fetch.js +265 -0
- package/groups/index.d.ts +49 -73
- package/groups/index.js +45 -64
- package/impersonate/index.d.ts +6 -15
- package/impersonate/index.js +5 -13
- package/index.d.ts +108 -154
- package/index.js +78 -109
- package/interfaces.d.ts +0 -10
- package/metadata/index.d.ts +7 -67
- package/metadata/index.js +32 -52
- package/node/ContextHolder/index.js +57 -153
- package/node/account-settings/index.js +16 -27
- package/node/applications/index.js +44 -51
- package/node/audits/index.js +20 -31
- package/node/auth/index.js +1035 -768
- package/node/auth/secutiry-poilicy/index.js +136 -125
- package/node/auth/utils.js +7 -9
- package/node/connectivity/index.js +187 -148
- package/node/directory/index.js +20 -29
- package/node/entitlements/index.js +5 -18
- package/node/feature-flags/index.js +9 -21
- package/node/fetch.js +306 -0
- package/node/groups/index.js +63 -65
- package/node/impersonate/index.js +5 -18
- package/node/index.js +71 -116
- package/node/metadata/index.js +52 -61
- package/node/notifications/index.js +27 -37
- package/node/reports/index.js +70 -78
- package/node/roles/index.js +51 -56
- package/node/security-center/index.js +9 -21
- package/node/sub-tenants/index.js +89 -90
- package/node/subscriptions/index.js +107 -69
- package/node/subscriptions/invoices.js +17 -25
- package/node/subscriptions/managedSubscriptions.js +27 -32
- package/node/subscriptions/paymentMethods.js +20 -27
- package/node/subscriptions/paymentProviders.js +6 -15
- package/node/subscriptions/plans.js +9 -17
- package/node/subscriptions/providers/index.js +18 -0
- package/node/subscriptions/providers/stripe/index.js +21 -26
- package/node/subscriptions/subscriptions.js +27 -32
- package/node/subscriptions/summaries.js +6 -15
- package/node/subscriptions/tenantConfiguration.js +9 -17
- package/node/subscriptions/vendorPublicConfigurations.js +6 -15
- package/node/teams/index.js +138 -130
- package/node/tenants/index.js +60 -65
- package/node/user-phone-numbers/index.js +24 -32
- package/node/users/index.js +53 -58
- package/node/vendor/index.js +6 -17
- package/notifications/index.d.ts +16 -22
- package/notifications/index.js +22 -33
- package/package.json +1 -1
- package/reports/index.d.ts +44 -50
- package/reports/index.js +62 -75
- package/roles/index.d.ts +38 -44
- package/roles/index.js +41 -57
- package/security-center/index.d.ts +2 -14
- package/security-center/index.js +6 -15
- package/sub-tenants/index.d.ts +15 -57
- package/sub-tenants/index.js +68 -88
- package/subscriptions/index.d.ts +11 -56
- package/subscriptions/index.js +11 -58
- package/subscriptions/invoices.d.ts +13 -16
- package/subscriptions/invoices.js +14 -24
- package/subscriptions/managedSubscriptions.d.ts +15 -18
- package/subscriptions/managedSubscriptions.js +22 -33
- package/subscriptions/paymentMethods.d.ts +13 -16
- package/subscriptions/paymentMethods.js +17 -26
- package/subscriptions/paymentProviders.d.ts +5 -8
- package/subscriptions/paymentProviders.js +4 -11
- package/subscriptions/plans.d.ts +8 -11
- package/subscriptions/plans.js +6 -14
- package/subscriptions/providers/index.d.ts +1 -0
- package/subscriptions/providers/index.js +1 -0
- package/subscriptions/providers/stripe/index.d.ts +21 -24
- package/subscriptions/providers/stripe/index.js +16 -27
- package/subscriptions/subscriptions.d.ts +21 -24
- package/subscriptions/subscriptions.js +22 -33
- package/subscriptions/summaries.d.ts +4 -7
- package/subscriptions/summaries.js +3 -10
- package/subscriptions/tenantConfiguration.d.ts +3 -6
- package/subscriptions/tenantConfiguration.js +7 -15
- package/subscriptions/vendorPublicConfigurations.d.ts +2 -5
- package/subscriptions/vendorPublicConfigurations.js +4 -11
- package/teams/index.d.ts +131 -35
- package/teams/index.js +93 -122
- package/tenants/index.d.ts +37 -25
- package/tenants/index.js +46 -62
- package/user-phone-numbers/index.d.ts +26 -32
- package/user-phone-numbers/index.js +19 -32
- package/users/index.d.ts +15 -21
- package/users/index.js +44 -60
- package/vendor/index.d.ts +6 -12
- package/vendor/index.js +4 -11
- package/BaseApiClient.d.ts +0 -16
- package/BaseApiClient.js +0 -39
- package/FetchClient.d.ts +0 -42
- package/FetchClient.js +0 -308
- package/node/BaseApiClient.js +0 -49
- package/node/FetchClient.js +0 -326
package/node/auth/index.js
CHANGED
|
@@ -6,50 +6,349 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
var _exportNames = {
|
|
9
|
-
|
|
9
|
+
generateLoginResponse: true,
|
|
10
|
+
generateLoginResponseV2: true,
|
|
11
|
+
generateLoginResponseV3: true,
|
|
12
|
+
generateLoginResponseFromOAuthResponse: true,
|
|
13
|
+
generateLoginResponseFromOAuthResponseV2: true,
|
|
14
|
+
preLogin: true,
|
|
15
|
+
preLoginWithIdpType: true,
|
|
16
|
+
postLogin: true,
|
|
17
|
+
oidcPostLogin: true,
|
|
18
|
+
login: true,
|
|
19
|
+
loginv2: true,
|
|
20
|
+
loginWithMfa: true,
|
|
21
|
+
loginWithMfaV2: true,
|
|
22
|
+
activateAccount: true,
|
|
23
|
+
activateAccountV2: true,
|
|
24
|
+
getActivateAccountStrategy: true,
|
|
25
|
+
resendActivationEmail: true,
|
|
26
|
+
resendInvitationEmail: true,
|
|
27
|
+
acceptInvitation: true,
|
|
28
|
+
refreshToken: true,
|
|
29
|
+
refreshTokenV2: true,
|
|
30
|
+
refreshTokenV3: true,
|
|
31
|
+
logout: true,
|
|
32
|
+
OAuthLogout: true,
|
|
33
|
+
forgotPassword: true,
|
|
34
|
+
resetPassword: true,
|
|
35
|
+
loadPasswordConfig: true,
|
|
36
|
+
recoverMfaToken: true,
|
|
37
|
+
enrollMfa: true,
|
|
38
|
+
preEnrollMFAAuthenticatorApp: true,
|
|
39
|
+
enrollMFAAuthenticatorApp: true,
|
|
40
|
+
preEnrollMFASMS: true,
|
|
41
|
+
enrollMFASMS: true,
|
|
42
|
+
preEnrollMFAWebAuthn: true,
|
|
43
|
+
enrollMFAWebAuthn: true,
|
|
44
|
+
verifyMfa: true,
|
|
45
|
+
disableMfa: true,
|
|
46
|
+
disableMFAAuthenticatorApp: true,
|
|
47
|
+
preDisableMFASMS: true,
|
|
48
|
+
disableMFASMS: true,
|
|
49
|
+
preDisableMFAWebAuthn: true,
|
|
50
|
+
disableMFAWebAuthn: true,
|
|
51
|
+
getMFADevices: true,
|
|
52
|
+
preEnrollMFAAuthenticatorAppForLogin: true,
|
|
53
|
+
enrollMFAAuthenticatorAppForLogin: true,
|
|
54
|
+
enrollMFAAuthenticatorAppForLoginV2: true,
|
|
55
|
+
verifyMFAAuthenticatorAppForLogin: true,
|
|
56
|
+
preVerifyMFAEmailCode: true,
|
|
57
|
+
verifyMFAEmailCode: true,
|
|
58
|
+
verifyMFAEmailCodeV2: true,
|
|
59
|
+
preEnrollMFASMSForLogin: true,
|
|
60
|
+
enrollMFASMSForLogin: true,
|
|
61
|
+
enrollMFASMSForLoginV2: true,
|
|
62
|
+
preVerifyMFASMSForLogin: true,
|
|
63
|
+
verifyMFASMSForLogin: true,
|
|
64
|
+
verifyMFASMSForLoginV2: true,
|
|
65
|
+
preEnrollMFAWebAuthnForLogin: true,
|
|
66
|
+
enrollMFAWebAuthnForLogin: true,
|
|
67
|
+
enrollMFAWebAuthnForLoginV2: true,
|
|
68
|
+
preVerifyMFAWebAuthnForLogin: true,
|
|
69
|
+
verifyMFAWebAuthnForLogin: true,
|
|
70
|
+
verifyMFAWebAuthnForLoginV2: true,
|
|
71
|
+
getSamlConfiguration: true,
|
|
72
|
+
updateSamlConfiguration: true,
|
|
73
|
+
getSamlVendorConfiguration: true,
|
|
74
|
+
updateSamlVendorMetadata: true,
|
|
75
|
+
validateSamlDomain: true,
|
|
76
|
+
getSamlRoles: true,
|
|
77
|
+
getSamlRolesGroups: true,
|
|
78
|
+
updateSamlRoles: true,
|
|
79
|
+
createSamlGroup: true,
|
|
80
|
+
updateSamlGroup: true,
|
|
81
|
+
deleteSamlGroup: true,
|
|
82
|
+
getOidcConfiguration: true,
|
|
83
|
+
getSSOPublicConfiguration: true,
|
|
84
|
+
getSocialLoginProviders: true,
|
|
85
|
+
getSocialLoginProvidersV2: true,
|
|
86
|
+
getSocialLoginProvidersV2ForAuthenticatedUser: true,
|
|
87
|
+
getCustomSocialLoginProvidersV1: true,
|
|
88
|
+
loginViaSocialLogin: true,
|
|
89
|
+
getVendorConfig: true,
|
|
90
|
+
signUpUser: true,
|
|
91
|
+
getCurrentUserSessions: true,
|
|
92
|
+
getCurrentUserSession: true,
|
|
93
|
+
revokeSessionsForUser: true,
|
|
94
|
+
getSessionConfigurations: true,
|
|
95
|
+
createOrUpdateSessionConfigrations: true,
|
|
96
|
+
deleteSessionForUser: true,
|
|
97
|
+
deleteAllSessionsForUser: true,
|
|
98
|
+
getUserAccessTokensData: true,
|
|
99
|
+
getTenantAccessTokensData: true,
|
|
100
|
+
deleteTenantAccessToken: true,
|
|
101
|
+
deleteUserAccessToken: true,
|
|
102
|
+
createUserAccessToken: true,
|
|
103
|
+
createTenantAccessToken: true,
|
|
104
|
+
getUserApiTokensData: true,
|
|
105
|
+
getTenantApiTokensData: true,
|
|
106
|
+
updateUserApiTokensData: true,
|
|
107
|
+
updateTenantApiTokensData: true,
|
|
108
|
+
deleteTenantApiToken: true,
|
|
109
|
+
deleteUserApiToken: true,
|
|
110
|
+
getUserById: true,
|
|
111
|
+
checkIfAllowToRememberMfaDevice: true,
|
|
112
|
+
passwordlessPreLogin: true,
|
|
113
|
+
passwordlessPostLoginV2: true,
|
|
114
|
+
passwordlessPostLogin: true,
|
|
115
|
+
verifyInviteToken: true,
|
|
116
|
+
getSSOConfigurations: true,
|
|
117
|
+
createSSOConfiguration: true,
|
|
118
|
+
updateSSOConfiguration: true,
|
|
119
|
+
deleteSSOConfiguration: true,
|
|
120
|
+
createSSOConfigurationByMetadata: true,
|
|
121
|
+
updateSSOConfigurationByMetadata: true,
|
|
122
|
+
createSSOConfigurationByMetadataUrl: true,
|
|
123
|
+
updateSSOConfigurationByMetadataUrl: true,
|
|
124
|
+
createSSODomain: true,
|
|
125
|
+
deleteSSODomain: true,
|
|
126
|
+
validateSSODomain: true,
|
|
127
|
+
validateSSODomainV2: true,
|
|
128
|
+
getSSODefaultRoles: true,
|
|
129
|
+
setSSODefaultRoles: true,
|
|
130
|
+
createSSOGroup: true,
|
|
131
|
+
updateSSOGroup: true,
|
|
132
|
+
deleteSSOGroup: true,
|
|
133
|
+
getSSOGroups: true,
|
|
134
|
+
preLoginV2: true,
|
|
135
|
+
oidcPostLoginV2: true,
|
|
136
|
+
exchangeOAuthTokensV2: true,
|
|
137
|
+
silentOAuthRefreshTokenV2: true,
|
|
138
|
+
exchangeOAuthTokens: true,
|
|
139
|
+
silentOAuthRefreshToken: true,
|
|
140
|
+
resetPhoneNumber: true,
|
|
141
|
+
verifyResetPhoneNumber: true,
|
|
142
|
+
changePhoneNumberWithVerification: true,
|
|
143
|
+
verifyChangePhoneNumber: true,
|
|
144
|
+
changePhoneNumber: true,
|
|
145
|
+
webAuthnPreLogin: true,
|
|
146
|
+
webAuthnPostLogin: true,
|
|
147
|
+
webAuthnPostLoginV2: true,
|
|
148
|
+
webAuthnCreateNewDeviceSession: true,
|
|
149
|
+
getWebAuthnDevices: true,
|
|
150
|
+
deleteWebAuthnDevice: true,
|
|
151
|
+
verifyNewDeviceSession: true,
|
|
152
|
+
getVendorPublicAuthStrategiesConfig: true,
|
|
153
|
+
getPublicAuthStrategiesConfigForAuthenticatedUser: true,
|
|
154
|
+
getMFAStrategiesConfig: true,
|
|
155
|
+
getUserAuthorization: true,
|
|
156
|
+
getMeV2: true,
|
|
157
|
+
getMeAndEntitlements: true,
|
|
158
|
+
generateStepupSession: true,
|
|
10
159
|
FRONTEGG_SEPARATE_TABS_BY_TENANT: true,
|
|
11
160
|
setTabTenantInSessionStorage: true,
|
|
12
161
|
getTabTenantFromSessionStorage: true,
|
|
13
162
|
getCurrentUserTenantsFunction: true,
|
|
14
163
|
removeTabTenantFromSessionStorage: true
|
|
15
164
|
};
|
|
16
|
-
exports.AuthenticationApi = void 0;
|
|
17
165
|
Object.defineProperty(exports, "FRONTEGG_SEPARATE_TABS_BY_TENANT", {
|
|
18
166
|
enumerable: true,
|
|
19
167
|
get: function () {
|
|
20
168
|
return _constants.FRONTEGG_SEPARATE_TABS_BY_TENANT;
|
|
21
169
|
}
|
|
22
170
|
});
|
|
23
|
-
exports.
|
|
171
|
+
exports.OAuthLogout = OAuthLogout;
|
|
172
|
+
exports.acceptInvitation = acceptInvitation;
|
|
173
|
+
exports.activateAccount = activateAccount;
|
|
174
|
+
exports.activateAccountV2 = activateAccountV2;
|
|
175
|
+
exports.changePhoneNumber = changePhoneNumber;
|
|
176
|
+
exports.changePhoneNumberWithVerification = changePhoneNumberWithVerification;
|
|
177
|
+
exports.checkIfAllowToRememberMfaDevice = checkIfAllowToRememberMfaDevice;
|
|
178
|
+
exports.createOrUpdateSessionConfigrations = createOrUpdateSessionConfigrations;
|
|
179
|
+
exports.createSSOConfiguration = createSSOConfiguration;
|
|
180
|
+
exports.createSSOConfigurationByMetadata = createSSOConfigurationByMetadata;
|
|
181
|
+
exports.createSSOConfigurationByMetadataUrl = createSSOConfigurationByMetadataUrl;
|
|
182
|
+
exports.createSSODomain = createSSODomain;
|
|
183
|
+
exports.createSSOGroup = createSSOGroup;
|
|
184
|
+
exports.createSamlGroup = createSamlGroup;
|
|
185
|
+
exports.createTenantAccessToken = createTenantAccessToken;
|
|
186
|
+
exports.createUserAccessToken = createUserAccessToken;
|
|
187
|
+
exports.deleteAllSessionsForUser = deleteAllSessionsForUser;
|
|
188
|
+
exports.deleteSSOConfiguration = deleteSSOConfiguration;
|
|
189
|
+
exports.deleteSSODomain = deleteSSODomain;
|
|
190
|
+
exports.deleteSSOGroup = deleteSSOGroup;
|
|
191
|
+
exports.deleteSamlGroup = deleteSamlGroup;
|
|
192
|
+
exports.deleteSessionForUser = deleteSessionForUser;
|
|
193
|
+
exports.deleteTenantAccessToken = deleteTenantAccessToken;
|
|
194
|
+
exports.deleteTenantApiToken = deleteTenantApiToken;
|
|
195
|
+
exports.deleteUserAccessToken = deleteUserAccessToken;
|
|
196
|
+
exports.deleteUserApiToken = deleteUserApiToken;
|
|
197
|
+
exports.deleteWebAuthnDevice = deleteWebAuthnDevice;
|
|
198
|
+
exports.disableMFAAuthenticatorApp = disableMFAAuthenticatorApp;
|
|
199
|
+
exports.disableMFASMS = disableMFASMS;
|
|
200
|
+
exports.disableMFAWebAuthn = disableMFAWebAuthn;
|
|
201
|
+
exports.disableMfa = disableMfa;
|
|
202
|
+
exports.enrollMFAAuthenticatorApp = enrollMFAAuthenticatorApp;
|
|
203
|
+
exports.enrollMFAAuthenticatorAppForLogin = enrollMFAAuthenticatorAppForLogin;
|
|
204
|
+
exports.enrollMFAAuthenticatorAppForLoginV2 = enrollMFAAuthenticatorAppForLoginV2;
|
|
205
|
+
exports.enrollMFASMS = enrollMFASMS;
|
|
206
|
+
exports.enrollMFASMSForLogin = enrollMFASMSForLogin;
|
|
207
|
+
exports.enrollMFASMSForLoginV2 = enrollMFASMSForLoginV2;
|
|
208
|
+
exports.enrollMFAWebAuthn = enrollMFAWebAuthn;
|
|
209
|
+
exports.enrollMFAWebAuthnForLogin = enrollMFAWebAuthnForLogin;
|
|
210
|
+
exports.enrollMFAWebAuthnForLoginV2 = enrollMFAWebAuthnForLoginV2;
|
|
211
|
+
exports.enrollMfa = enrollMfa;
|
|
212
|
+
exports.exchangeOAuthTokens = exchangeOAuthTokens;
|
|
213
|
+
exports.exchangeOAuthTokensV2 = exchangeOAuthTokensV2;
|
|
214
|
+
exports.forgotPassword = forgotPassword;
|
|
215
|
+
exports.generateLoginResponse = generateLoginResponse;
|
|
216
|
+
exports.generateLoginResponseFromOAuthResponse = generateLoginResponseFromOAuthResponse;
|
|
217
|
+
exports.generateLoginResponseFromOAuthResponseV2 = generateLoginResponseFromOAuthResponseV2;
|
|
218
|
+
exports.generateLoginResponseV2 = generateLoginResponseV2;
|
|
219
|
+
exports.generateLoginResponseV3 = generateLoginResponseV3;
|
|
220
|
+
exports.generateStepupSession = generateStepupSession;
|
|
221
|
+
exports.getActivateAccountStrategy = getActivateAccountStrategy;
|
|
222
|
+
exports.getCurrentUserSession = getCurrentUserSession;
|
|
223
|
+
exports.getCurrentUserSessions = getCurrentUserSessions;
|
|
24
224
|
Object.defineProperty(exports, "getCurrentUserTenantsFunction", {
|
|
25
225
|
enumerable: true,
|
|
26
226
|
get: function () {
|
|
27
227
|
return _utils.getCurrentUserTenantsFunction;
|
|
28
228
|
}
|
|
29
229
|
});
|
|
230
|
+
exports.getCustomSocialLoginProvidersV1 = getCustomSocialLoginProvidersV1;
|
|
231
|
+
exports.getMFADevices = getMFADevices;
|
|
232
|
+
exports.getMFAStrategiesConfig = getMFAStrategiesConfig;
|
|
233
|
+
exports.getMeAndEntitlements = getMeAndEntitlements;
|
|
234
|
+
exports.getMeV2 = getMeV2;
|
|
235
|
+
exports.getOidcConfiguration = getOidcConfiguration;
|
|
236
|
+
exports.getPublicAuthStrategiesConfigForAuthenticatedUser = getPublicAuthStrategiesConfigForAuthenticatedUser;
|
|
237
|
+
exports.getSSOConfigurations = getSSOConfigurations;
|
|
238
|
+
exports.getSSODefaultRoles = getSSODefaultRoles;
|
|
239
|
+
exports.getSSOGroups = getSSOGroups;
|
|
240
|
+
exports.getSSOPublicConfiguration = getSSOPublicConfiguration;
|
|
241
|
+
exports.getSamlConfiguration = getSamlConfiguration;
|
|
242
|
+
exports.getSamlRoles = getSamlRoles;
|
|
243
|
+
exports.getSamlRolesGroups = getSamlRolesGroups;
|
|
244
|
+
exports.getSamlVendorConfiguration = getSamlVendorConfiguration;
|
|
245
|
+
exports.getSessionConfigurations = getSessionConfigurations;
|
|
246
|
+
exports.getSocialLoginProviders = getSocialLoginProviders;
|
|
247
|
+
exports.getSocialLoginProvidersV2 = getSocialLoginProvidersV2;
|
|
248
|
+
exports.getSocialLoginProvidersV2ForAuthenticatedUser = getSocialLoginProvidersV2ForAuthenticatedUser;
|
|
30
249
|
Object.defineProperty(exports, "getTabTenantFromSessionStorage", {
|
|
31
250
|
enumerable: true,
|
|
32
251
|
get: function () {
|
|
33
252
|
return _utils.getTabTenantFromSessionStorage;
|
|
34
253
|
}
|
|
35
254
|
});
|
|
255
|
+
exports.getTenantAccessTokensData = getTenantAccessTokensData;
|
|
256
|
+
exports.getTenantApiTokensData = getTenantApiTokensData;
|
|
257
|
+
exports.getUserAccessTokensData = getUserAccessTokensData;
|
|
258
|
+
exports.getUserApiTokensData = getUserApiTokensData;
|
|
259
|
+
exports.getUserAuthorization = getUserAuthorization;
|
|
260
|
+
exports.getUserById = getUserById;
|
|
261
|
+
exports.getVendorConfig = getVendorConfig;
|
|
262
|
+
exports.getVendorPublicAuthStrategiesConfig = getVendorPublicAuthStrategiesConfig;
|
|
263
|
+
exports.getWebAuthnDevices = getWebAuthnDevices;
|
|
264
|
+
exports.loadPasswordConfig = loadPasswordConfig;
|
|
265
|
+
exports.login = login;
|
|
266
|
+
exports.loginViaSocialLogin = loginViaSocialLogin;
|
|
267
|
+
exports.loginWithMfa = loginWithMfa;
|
|
268
|
+
exports.loginWithMfaV2 = loginWithMfaV2;
|
|
269
|
+
exports.loginv2 = loginv2;
|
|
270
|
+
exports.logout = logout;
|
|
271
|
+
exports.oidcPostLogin = oidcPostLogin;
|
|
272
|
+
exports.oidcPostLoginV2 = oidcPostLoginV2;
|
|
273
|
+
exports.passwordlessPostLogin = passwordlessPostLogin;
|
|
274
|
+
exports.passwordlessPostLoginV2 = passwordlessPostLoginV2;
|
|
275
|
+
exports.passwordlessPreLogin = passwordlessPreLogin;
|
|
276
|
+
exports.postLogin = postLogin;
|
|
277
|
+
exports.preDisableMFASMS = preDisableMFASMS;
|
|
278
|
+
exports.preDisableMFAWebAuthn = preDisableMFAWebAuthn;
|
|
279
|
+
exports.preEnrollMFAAuthenticatorApp = preEnrollMFAAuthenticatorApp;
|
|
280
|
+
exports.preEnrollMFAAuthenticatorAppForLogin = preEnrollMFAAuthenticatorAppForLogin;
|
|
281
|
+
exports.preEnrollMFASMS = preEnrollMFASMS;
|
|
282
|
+
exports.preEnrollMFASMSForLogin = preEnrollMFASMSForLogin;
|
|
283
|
+
exports.preEnrollMFAWebAuthn = preEnrollMFAWebAuthn;
|
|
284
|
+
exports.preEnrollMFAWebAuthnForLogin = preEnrollMFAWebAuthnForLogin;
|
|
285
|
+
exports.preLogin = preLogin;
|
|
286
|
+
exports.preLoginV2 = preLoginV2;
|
|
287
|
+
exports.preLoginWithIdpType = preLoginWithIdpType;
|
|
288
|
+
exports.preVerifyMFAEmailCode = preVerifyMFAEmailCode;
|
|
289
|
+
exports.preVerifyMFASMSForLogin = preVerifyMFASMSForLogin;
|
|
290
|
+
exports.preVerifyMFAWebAuthnForLogin = preVerifyMFAWebAuthnForLogin;
|
|
291
|
+
exports.recoverMfaToken = recoverMfaToken;
|
|
292
|
+
exports.refreshToken = refreshToken;
|
|
293
|
+
exports.refreshTokenV2 = refreshTokenV2;
|
|
294
|
+
exports.refreshTokenV3 = refreshTokenV3;
|
|
36
295
|
Object.defineProperty(exports, "removeTabTenantFromSessionStorage", {
|
|
37
296
|
enumerable: true,
|
|
38
297
|
get: function () {
|
|
39
298
|
return _utils.removeTabTenantFromSessionStorage;
|
|
40
299
|
}
|
|
41
300
|
});
|
|
301
|
+
exports.resendActivationEmail = resendActivationEmail;
|
|
302
|
+
exports.resendInvitationEmail = resendInvitationEmail;
|
|
303
|
+
exports.resetPassword = resetPassword;
|
|
304
|
+
exports.resetPhoneNumber = resetPhoneNumber;
|
|
305
|
+
exports.revokeSessionsForUser = revokeSessionsForUser;
|
|
306
|
+
exports.setSSODefaultRoles = setSSODefaultRoles;
|
|
42
307
|
Object.defineProperty(exports, "setTabTenantInSessionStorage", {
|
|
43
308
|
enumerable: true,
|
|
44
309
|
get: function () {
|
|
45
310
|
return _utils.setTabTenantInSessionStorage;
|
|
46
311
|
}
|
|
47
312
|
});
|
|
313
|
+
exports.signUpUser = signUpUser;
|
|
314
|
+
exports.silentOAuthRefreshToken = silentOAuthRefreshToken;
|
|
315
|
+
exports.silentOAuthRefreshTokenV2 = silentOAuthRefreshTokenV2;
|
|
316
|
+
exports.updateSSOConfiguration = updateSSOConfiguration;
|
|
317
|
+
exports.updateSSOConfigurationByMetadata = updateSSOConfigurationByMetadata;
|
|
318
|
+
exports.updateSSOConfigurationByMetadataUrl = updateSSOConfigurationByMetadataUrl;
|
|
319
|
+
exports.updateSSOGroup = updateSSOGroup;
|
|
320
|
+
exports.updateSamlConfiguration = updateSamlConfiguration;
|
|
321
|
+
exports.updateSamlGroup = updateSamlGroup;
|
|
322
|
+
exports.updateSamlRoles = updateSamlRoles;
|
|
323
|
+
exports.updateSamlVendorMetadata = updateSamlVendorMetadata;
|
|
324
|
+
exports.updateTenantApiTokensData = updateTenantApiTokensData;
|
|
325
|
+
exports.updateUserApiTokensData = updateUserApiTokensData;
|
|
326
|
+
exports.validateSSODomain = validateSSODomain;
|
|
327
|
+
exports.validateSSODomainV2 = validateSSODomainV2;
|
|
328
|
+
exports.validateSamlDomain = validateSamlDomain;
|
|
329
|
+
exports.verifyChangePhoneNumber = verifyChangePhoneNumber;
|
|
330
|
+
exports.verifyInviteToken = verifyInviteToken;
|
|
331
|
+
exports.verifyMFAAuthenticatorAppForLogin = verifyMFAAuthenticatorAppForLogin;
|
|
332
|
+
exports.verifyMFAEmailCode = verifyMFAEmailCode;
|
|
333
|
+
exports.verifyMFAEmailCodeV2 = verifyMFAEmailCodeV2;
|
|
334
|
+
exports.verifyMFASMSForLogin = verifyMFASMSForLogin;
|
|
335
|
+
exports.verifyMFASMSForLoginV2 = verifyMFASMSForLoginV2;
|
|
336
|
+
exports.verifyMFAWebAuthnForLogin = verifyMFAWebAuthnForLogin;
|
|
337
|
+
exports.verifyMFAWebAuthnForLoginV2 = verifyMFAWebAuthnForLoginV2;
|
|
338
|
+
exports.verifyMfa = verifyMfa;
|
|
339
|
+
exports.verifyNewDeviceSession = verifyNewDeviceSession;
|
|
340
|
+
exports.verifyResetPhoneNumber = verifyResetPhoneNumber;
|
|
341
|
+
exports.webAuthnCreateNewDeviceSession = webAuthnCreateNewDeviceSession;
|
|
342
|
+
exports.webAuthnPostLogin = webAuthnPostLogin;
|
|
343
|
+
exports.webAuthnPostLoginV2 = webAuthnPostLoginV2;
|
|
344
|
+
exports.webAuthnPreLogin = webAuthnPreLogin;
|
|
48
345
|
|
|
49
346
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
50
347
|
|
|
51
348
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
52
349
|
|
|
350
|
+
var _tenants = require("../tenants");
|
|
351
|
+
|
|
53
352
|
var _secutiryPoilicy = require("./secutiry-poilicy");
|
|
54
353
|
|
|
55
354
|
Object.keys(_secutiryPoilicy).forEach(function (key) {
|
|
@@ -84,953 +383,921 @@ var _utils = require("./utils");
|
|
|
84
383
|
|
|
85
384
|
var _constants2 = require("../constants");
|
|
86
385
|
|
|
386
|
+
var _ContextHolder = require("../ContextHolder");
|
|
387
|
+
|
|
388
|
+
var _fetch = require("../fetch");
|
|
389
|
+
|
|
87
390
|
var _jwt = require("../jwt");
|
|
88
391
|
|
|
89
392
|
var _interfaces = require("./interfaces");
|
|
90
393
|
|
|
394
|
+
var _entitlements = require("../entitlements");
|
|
395
|
+
|
|
91
396
|
var _interfaces2 = require("../entitlements/interfaces");
|
|
92
397
|
|
|
93
398
|
var _featureFlags = require("../feature-flags");
|
|
94
399
|
|
|
95
|
-
|
|
400
|
+
const _excluded = ["type"],
|
|
401
|
+
_excluded2 = ["type"],
|
|
402
|
+
_excluded3 = ["type"];
|
|
96
403
|
|
|
97
|
-
|
|
404
|
+
async function generateLoginResponse(loginResponse) {
|
|
405
|
+
if (!loginResponse.accessToken) {
|
|
406
|
+
return loginResponse;
|
|
407
|
+
}
|
|
98
408
|
|
|
99
|
-
|
|
409
|
+
_ContextHolder.ContextHolder.setAccessToken(loginResponse.accessToken);
|
|
100
410
|
|
|
101
|
-
|
|
411
|
+
const me = await getMeAndEntitlements();
|
|
412
|
+
const decodedContent = loginResponse.accessToken ? (0, _jwt.jwtDecode)(loginResponse.accessToken) : {};
|
|
413
|
+
const user = (0, _extends2.default)({}, loginResponse, decodedContent, me);
|
|
102
414
|
|
|
103
|
-
|
|
104
|
-
_excluded2 = ["type"],
|
|
105
|
-
_excluded3 = ["type"];
|
|
415
|
+
_ContextHolder.ContextHolder.setUser(user);
|
|
106
416
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
super(appName);
|
|
110
|
-
this.tenantsApi = new _tenants.TenantsApi(this.appName);
|
|
111
|
-
this.entitlementsApi = new _entitlements.EntitlementsApi(this.appName);
|
|
112
|
-
this.securityPolicy = new _secutiryPoilicy.SecurityPolicyApi(this.appName);
|
|
113
|
-
|
|
114
|
-
this.generateLoginResponse = async loginResponse => {
|
|
115
|
-
if (!loginResponse.accessToken) {
|
|
116
|
-
return loginResponse;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const contextHolder = _ContextHolder.ContextHolder.for(this.appName);
|
|
120
|
-
|
|
121
|
-
contextHolder.setAccessToken(loginResponse.accessToken);
|
|
122
|
-
const me = await this.getMeAndEntitlements();
|
|
123
|
-
const decodedContent = loginResponse.accessToken ? (0, _jwt.jwtDecode)(loginResponse.accessToken) : {};
|
|
124
|
-
const user = (0, _extends2.default)({}, loginResponse, decodedContent, me);
|
|
125
|
-
contextHolder.setUser(user);
|
|
126
|
-
return user;
|
|
127
|
-
};
|
|
417
|
+
return user;
|
|
418
|
+
}
|
|
128
419
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const contextHolder = _ContextHolder.ContextHolder.for(this.appName);
|
|
137
|
-
|
|
138
|
-
contextHolder.setAccessToken(loginResponse.accessToken);
|
|
139
|
-
const [me, tenants] = await Promise.all([this.getMeAndEntitlements(), this.tenantsApi.getTenants()]);
|
|
140
|
-
const decodedContent = loginResponse.accessToken ? (0, _jwt.jwtDecode)(loginResponse.accessToken) : {};
|
|
141
|
-
const user = (0, _extends2.default)({}, loginResponse, decodedContent, me);
|
|
142
|
-
contextHolder.setUser(user);
|
|
143
|
-
return {
|
|
144
|
-
user,
|
|
145
|
-
tenants
|
|
146
|
-
};
|
|
420
|
+
async function generateLoginResponseV2(loginResponse) {
|
|
421
|
+
if (!loginResponse.accessToken) {
|
|
422
|
+
return {
|
|
423
|
+
user: loginResponse
|
|
147
424
|
};
|
|
425
|
+
}
|
|
148
426
|
|
|
149
|
-
|
|
150
|
-
const {
|
|
151
|
-
accessToken
|
|
152
|
-
} = loginResponse;
|
|
153
|
-
|
|
154
|
-
if (!accessToken) {
|
|
155
|
-
return {
|
|
156
|
-
user: loginResponse
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
const contextHolder = _ContextHolder.ContextHolder.for(this.appName);
|
|
161
|
-
|
|
162
|
-
contextHolder.setAccessToken(accessToken);
|
|
163
|
-
const [me, currentUserTenants] = await Promise.all([this.getMeAndEntitlements(), (0, _utils.getCurrentUserTenantsFunction)(this.appName)()]);
|
|
164
|
-
const decodedContent = accessToken ? (0, _jwt.jwtDecode)(accessToken) : {};
|
|
165
|
-
const user = (0, _extends2.default)({}, loginResponse, decodedContent, me);
|
|
166
|
-
|
|
167
|
-
if (contextHolder.isSessionPerTenantEnabled()) {
|
|
168
|
-
(0, _utils.setTabTenantInSessionStorage)(user.tenantId);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
contextHolder.setUser(user);
|
|
172
|
-
return {
|
|
173
|
-
user,
|
|
174
|
-
tenants: currentUserTenants.tenants,
|
|
175
|
-
activeTenant: currentUserTenants.activeTenant
|
|
176
|
-
};
|
|
177
|
-
};
|
|
427
|
+
_ContextHolder.ContextHolder.setAccessToken(loginResponse.accessToken);
|
|
178
428
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
contextHolder.setAccessToken(oauthResponse.id_token);
|
|
183
|
-
const me = await this.getMeAndEntitlements();
|
|
184
|
-
const decodedContent = oauthResponse.id_token ? (0, _jwt.jwtDecode)(oauthResponse.id_token) : {};
|
|
185
|
-
const user = (0, _extends2.default)({
|
|
186
|
-
mfaRequired: false,
|
|
187
|
-
accessToken: oauthResponse.id_token,
|
|
188
|
-
refreshToken: oauthResponse.refresh_token
|
|
189
|
-
}, decodedContent, me, {
|
|
190
|
-
expiresIn: oauthResponse.expires_in || 300
|
|
191
|
-
});
|
|
192
|
-
contextHolder.setUser(user);
|
|
193
|
-
return user;
|
|
194
|
-
};
|
|
429
|
+
const [me, tenants] = await Promise.all([getMeAndEntitlements(), (0, _tenants.getTenants)()]);
|
|
430
|
+
const decodedContent = loginResponse.accessToken ? (0, _jwt.jwtDecode)(loginResponse.accessToken) : {};
|
|
431
|
+
const user = (0, _extends2.default)({}, loginResponse, decodedContent, me);
|
|
195
432
|
|
|
196
|
-
|
|
197
|
-
const contextHolder = _ContextHolder.ContextHolder.for(this.appName);
|
|
198
|
-
|
|
199
|
-
contextHolder.setAccessToken(oauthResponse.id_token);
|
|
200
|
-
const [me, currentUserTenants] = await Promise.all([this.getMeAndEntitlements(), (0, _utils.getCurrentUserTenantsFunction)(this.appName)()]);
|
|
201
|
-
const decodedContent = oauthResponse.id_token ? (0, _jwt.jwtDecode)(oauthResponse.id_token) : {};
|
|
202
|
-
const user = (0, _extends2.default)({
|
|
203
|
-
mfaRequired: false,
|
|
204
|
-
accessToken: oauthResponse.id_token,
|
|
205
|
-
refreshToken: oauthResponse.refresh_token
|
|
206
|
-
}, decodedContent, me, {
|
|
207
|
-
expiresIn: oauthResponse.expires_in || 300
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
if (contextHolder.isSessionPerTenantEnabled()) {
|
|
211
|
-
(0, _utils.setTabTenantInSessionStorage)(user.tenantId);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
contextHolder.setUser(user);
|
|
215
|
-
return {
|
|
216
|
-
user,
|
|
217
|
-
tenants: currentUserTenants.tenants,
|
|
218
|
-
activeTenant: currentUserTenants.activeTenant
|
|
219
|
-
};
|
|
220
|
-
};
|
|
433
|
+
_ContextHolder.ContextHolder.setUser(user);
|
|
221
434
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
return address;
|
|
228
|
-
} catch {
|
|
229
|
-
return null;
|
|
230
|
-
}
|
|
231
|
-
};
|
|
435
|
+
return {
|
|
436
|
+
user,
|
|
437
|
+
tenants
|
|
438
|
+
};
|
|
439
|
+
}
|
|
232
440
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
441
|
+
function shouldLoadEntitlements() {
|
|
442
|
+
if (!_ContextHolder.ContextHolder.shouldLoadEntitlements()) {
|
|
443
|
+
return false;
|
|
444
|
+
}
|
|
236
445
|
|
|
237
|
-
|
|
238
|
-
const data = await this.post(`${_constants2.urls.identity.auth.v1}/user/saml/postlogin`, body);
|
|
239
|
-
return this.generateLoginResponse(data);
|
|
240
|
-
};
|
|
446
|
+
const [isEntitlementsFFOn] = _featureFlags.FeatureFlags.getFeatureFlags([_interfaces2.ADMIN_PORTAL_ENTITLEMENTS_FF], _ContextHolder.ContextHolder.getAppName() || '');
|
|
241
447
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
return this.generateLoginResponse(data);
|
|
245
|
-
};
|
|
448
|
+
return isEntitlementsFFOn;
|
|
449
|
+
}
|
|
246
450
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
return this.generateLoginResponse(data);
|
|
250
|
-
};
|
|
451
|
+
function shouldLoadMeAuthorization() {
|
|
452
|
+
const [shouldLoadAuthorization] = _featureFlags.FeatureFlags.getFeatureFlags([_interfaces.LOAD_AUTHORIZATION_FF], _ContextHolder.ContextHolder.getAppName() || '');
|
|
251
453
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
return this.generateLoginResponseV3(data);
|
|
255
|
-
};
|
|
454
|
+
return shouldLoadAuthorization;
|
|
455
|
+
}
|
|
256
456
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
457
|
+
async function generateLoginResponseV3(loginResponse) {
|
|
458
|
+
const {
|
|
459
|
+
accessToken
|
|
460
|
+
} = loginResponse;
|
|
261
461
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
462
|
+
if (!accessToken) {
|
|
463
|
+
return {
|
|
464
|
+
user: loginResponse
|
|
265
465
|
};
|
|
466
|
+
}
|
|
266
467
|
|
|
267
|
-
|
|
268
|
-
return this.post(`${_constants2.urls.identity.users.v1}/activate`, body);
|
|
269
|
-
};
|
|
468
|
+
_ContextHolder.ContextHolder.setAccessToken(accessToken);
|
|
270
469
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
};
|
|
470
|
+
const [me, currentUserTenants] = await Promise.all([getMeAndEntitlements(), (0, _utils.getCurrentUserTenantsFunction)()()]);
|
|
471
|
+
const decodedContent = accessToken ? (0, _jwt.jwtDecode)(accessToken) : {};
|
|
472
|
+
const user = (0, _extends2.default)({}, loginResponse, decodedContent, me);
|
|
275
473
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
474
|
+
if (_ContextHolder.ContextHolder.isSessionPerTenantEnabled()) {
|
|
475
|
+
(0, _utils.setTabTenantInSessionStorage)(user.tenantId);
|
|
476
|
+
}
|
|
279
477
|
|
|
280
|
-
|
|
281
|
-
return this.post(`${_constants2.urls.identity.users.v1}/activate/reset`, body);
|
|
282
|
-
};
|
|
478
|
+
_ContextHolder.ContextHolder.setUser(user);
|
|
283
479
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
480
|
+
return {
|
|
481
|
+
user,
|
|
482
|
+
tenants: currentUserTenants.tenants,
|
|
483
|
+
activeTenant: currentUserTenants.activeTenant
|
|
484
|
+
};
|
|
485
|
+
}
|
|
287
486
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
487
|
+
async function generateLoginResponseFromOAuthResponse(oauthResponse) {
|
|
488
|
+
_ContextHolder.ContextHolder.setAccessToken(oauthResponse.id_token);
|
|
489
|
+
|
|
490
|
+
const me = await getMeAndEntitlements();
|
|
491
|
+
const decodedContent = oauthResponse.id_token ? (0, _jwt.jwtDecode)(oauthResponse.id_token) : {};
|
|
492
|
+
const user = (0, _extends2.default)({
|
|
493
|
+
mfaRequired: false,
|
|
494
|
+
accessToken: oauthResponse.id_token,
|
|
495
|
+
refreshToken: oauthResponse.refresh_token
|
|
496
|
+
}, decodedContent, me, {
|
|
497
|
+
expiresIn: oauthResponse.expires_in || 300
|
|
498
|
+
});
|
|
291
499
|
|
|
292
|
-
|
|
293
|
-
const tabTenantId = (0, _utils.getTabTenantFromSessionStorage)(this.appName);
|
|
294
|
-
const data = await this.post(`${_constants2.urls.identity.auth.v1}/user/token/refresh`, {
|
|
295
|
-
tenantId: tabTenantId
|
|
296
|
-
});
|
|
297
|
-
return this.generateLoginResponse(data);
|
|
298
|
-
};
|
|
500
|
+
_ContextHolder.ContextHolder.setUser(user);
|
|
299
501
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
const data = await this.post(`${_constants2.urls.identity.auth.v1}/user/token/refresh`, {
|
|
303
|
-
tenantId: tabTenantId
|
|
304
|
-
});
|
|
305
|
-
return this.generateLoginResponseV2(data);
|
|
306
|
-
};
|
|
502
|
+
return user;
|
|
503
|
+
}
|
|
307
504
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
505
|
+
async function generateLoginResponseFromOAuthResponseV2(oauthResponse) {
|
|
506
|
+
_ContextHolder.ContextHolder.setAccessToken(oauthResponse.id_token);
|
|
507
|
+
|
|
508
|
+
const [me, currentUserTenants] = await Promise.all([getMeAndEntitlements(), (0, _utils.getCurrentUserTenantsFunction)()()]);
|
|
509
|
+
const decodedContent = oauthResponse.id_token ? (0, _jwt.jwtDecode)(oauthResponse.id_token) : {};
|
|
510
|
+
const user = (0, _extends2.default)({
|
|
511
|
+
mfaRequired: false,
|
|
512
|
+
accessToken: oauthResponse.id_token,
|
|
513
|
+
refreshToken: oauthResponse.refresh_token
|
|
514
|
+
}, decodedContent, me, {
|
|
515
|
+
expiresIn: oauthResponse.expires_in || 300
|
|
516
|
+
});
|
|
315
517
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
518
|
+
if (_ContextHolder.ContextHolder.isSessionPerTenantEnabled()) {
|
|
519
|
+
(0, _utils.setTabTenantInSessionStorage)(user.tenantId);
|
|
520
|
+
}
|
|
319
521
|
|
|
320
|
-
|
|
321
|
-
return this.get(`${_constants2.urls.oauth.v1}/logout`, params);
|
|
322
|
-
};
|
|
522
|
+
_ContextHolder.ContextHolder.setUser(user);
|
|
323
523
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
524
|
+
return {
|
|
525
|
+
user,
|
|
526
|
+
tenants: currentUserTenants.tenants,
|
|
527
|
+
activeTenant: currentUserTenants.activeTenant
|
|
528
|
+
};
|
|
529
|
+
}
|
|
327
530
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
531
|
+
async function preLogin(body) {
|
|
532
|
+
try {
|
|
533
|
+
const {
|
|
534
|
+
address
|
|
535
|
+
} = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/saml/prelogin`, body);
|
|
536
|
+
return address;
|
|
537
|
+
} catch {
|
|
538
|
+
return null;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
331
541
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
542
|
+
async function preLoginWithIdpType(body) {
|
|
543
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/saml/prelogin`, body);
|
|
544
|
+
}
|
|
335
545
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
546
|
+
async function postLogin(body) {
|
|
547
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/saml/postlogin`, body);
|
|
548
|
+
return generateLoginResponse(data);
|
|
549
|
+
}
|
|
339
550
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
551
|
+
async function oidcPostLogin(body) {
|
|
552
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/oidc/postlogin`, body);
|
|
553
|
+
return generateLoginResponse(data);
|
|
554
|
+
}
|
|
343
555
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
556
|
+
async function login(body) {
|
|
557
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user`, body);
|
|
558
|
+
return generateLoginResponse(data);
|
|
559
|
+
}
|
|
347
560
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
561
|
+
async function loginv2(body) {
|
|
562
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user`, body);
|
|
563
|
+
return generateLoginResponseV3(data);
|
|
564
|
+
}
|
|
351
565
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
566
|
+
async function loginWithMfa(body) {
|
|
567
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/verify`, body);
|
|
568
|
+
return generateLoginResponse(data);
|
|
569
|
+
}
|
|
355
570
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
571
|
+
async function loginWithMfaV2(body) {
|
|
572
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/verify`, body);
|
|
573
|
+
return generateLoginResponseV3(data);
|
|
574
|
+
}
|
|
359
575
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
576
|
+
async function activateAccount(body) {
|
|
577
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/activate`, body);
|
|
578
|
+
}
|
|
363
579
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
580
|
+
async function activateAccountV2(body) {
|
|
581
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/activate`, body);
|
|
582
|
+
return generateLoginResponseV3(data);
|
|
583
|
+
}
|
|
367
584
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
585
|
+
async function getActivateAccountStrategy(params) {
|
|
586
|
+
return (0, _fetch.Get)(`${_constants2.urls.identity.users.v1}/activate/strategy`, params);
|
|
587
|
+
}
|
|
371
588
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
589
|
+
async function resendActivationEmail(body) {
|
|
590
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/activate/reset`, body);
|
|
591
|
+
}
|
|
375
592
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
593
|
+
async function resendInvitationEmail(body) {
|
|
594
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/invitation/reset`, body);
|
|
595
|
+
}
|
|
379
596
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
597
|
+
async function acceptInvitation(body) {
|
|
598
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/invitation/accept`, body);
|
|
599
|
+
}
|
|
383
600
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
601
|
+
async function refreshToken() {
|
|
602
|
+
const tabTenantId = (0, _utils.getTabTenantFromSessionStorage)();
|
|
603
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/token/refresh`, {
|
|
604
|
+
tenantId: tabTenantId
|
|
605
|
+
});
|
|
606
|
+
return generateLoginResponse(data);
|
|
607
|
+
}
|
|
387
608
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
609
|
+
async function refreshTokenV2() {
|
|
610
|
+
const tabTenantId = (0, _utils.getTabTenantFromSessionStorage)();
|
|
611
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/token/refresh`, {
|
|
612
|
+
tenantId: tabTenantId
|
|
613
|
+
});
|
|
614
|
+
return generateLoginResponseV2(data);
|
|
615
|
+
}
|
|
391
616
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
617
|
+
async function refreshTokenV3() {
|
|
618
|
+
const tabTenantId = (0, _utils.getTabTenantFromSessionStorage)();
|
|
619
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/token/refresh`, {
|
|
620
|
+
tenantId: tabTenantId
|
|
621
|
+
});
|
|
622
|
+
return generateLoginResponseV3(data);
|
|
623
|
+
}
|
|
395
624
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
625
|
+
async function logout() {
|
|
626
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/logout`);
|
|
627
|
+
}
|
|
399
628
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
629
|
+
async function OAuthLogout(params) {
|
|
630
|
+
return (0, _fetch.Get)(`${_constants2.urls.oauth.v1}/logout`, params);
|
|
631
|
+
}
|
|
403
632
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
633
|
+
async function forgotPassword(body) {
|
|
634
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/passwords/reset`, body);
|
|
635
|
+
}
|
|
407
636
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
};
|
|
637
|
+
async function resetPassword(body) {
|
|
638
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/passwords/reset/verify`, body);
|
|
639
|
+
}
|
|
412
640
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
641
|
+
async function loadPasswordConfig(params) {
|
|
642
|
+
return (0, _fetch.Get)(`${_constants2.urls.identity.users.v1}/passwords/config`, params);
|
|
643
|
+
}
|
|
416
644
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
645
|
+
async function recoverMfaToken(body) {
|
|
646
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/recover`, body);
|
|
647
|
+
}
|
|
420
648
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
649
|
+
async function enrollMfa() {
|
|
650
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/mfa/enroll`);
|
|
651
|
+
}
|
|
424
652
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
};
|
|
653
|
+
async function preEnrollMFAAuthenticatorApp() {
|
|
654
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/mfa/authenticator/enroll`);
|
|
655
|
+
}
|
|
429
656
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
657
|
+
async function enrollMFAAuthenticatorApp(body) {
|
|
658
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/mfa/authenticator/enroll/verify`, body);
|
|
659
|
+
}
|
|
433
660
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
661
|
+
async function preEnrollMFASMS(body) {
|
|
662
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/mfa/sms/enroll`, body);
|
|
663
|
+
}
|
|
437
664
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
};
|
|
665
|
+
async function enrollMFASMS(body) {
|
|
666
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/mfa/sms/enroll/verify`, body);
|
|
667
|
+
}
|
|
442
668
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
669
|
+
async function preEnrollMFAWebAuthn() {
|
|
670
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/mfa/webauthn/enroll`);
|
|
671
|
+
}
|
|
446
672
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
673
|
+
async function enrollMFAWebAuthn(body) {
|
|
674
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/mfa/webauthn/enroll/verify`, body);
|
|
675
|
+
}
|
|
450
676
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
};
|
|
677
|
+
async function verifyMfa(body) {
|
|
678
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/mfa/enroll/verify`, body);
|
|
679
|
+
}
|
|
455
680
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
681
|
+
async function disableMfa(body) {
|
|
682
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/mfa/disable`, body);
|
|
683
|
+
}
|
|
459
684
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
685
|
+
async function disableMFAAuthenticatorApp(deviceId, body) {
|
|
686
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/mfa/authenticator/${deviceId}/disable/verify`, body);
|
|
687
|
+
}
|
|
463
688
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
};
|
|
689
|
+
async function preDisableMFASMS(deviceId) {
|
|
690
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/mfa/sms/${deviceId}/disable`);
|
|
691
|
+
}
|
|
468
692
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
693
|
+
async function disableMFASMS(deviceId, body) {
|
|
694
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/mfa/sms/${deviceId}/disable/verify`, body);
|
|
695
|
+
}
|
|
472
696
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
697
|
+
async function preDisableMFAWebAuthn(deviceId) {
|
|
698
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/mfa/webauthn/${deviceId}/disable`);
|
|
699
|
+
}
|
|
476
700
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
};
|
|
701
|
+
async function disableMFAWebAuthn(deviceId, body) {
|
|
702
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/mfa/webauthn/${deviceId}/disable/verify`, body);
|
|
703
|
+
}
|
|
481
704
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
705
|
+
async function getMFADevices() {
|
|
706
|
+
return (0, _fetch.Get)(`${_constants2.urls.identity.users.v1}/mfa/devices`);
|
|
707
|
+
}
|
|
485
708
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
709
|
+
async function preEnrollMFAAuthenticatorAppForLogin(body) {
|
|
710
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/authenticator/enroll`, body);
|
|
711
|
+
}
|
|
489
712
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
713
|
+
async function enrollMFAAuthenticatorAppForLogin(body) {
|
|
714
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/authenticator/enroll/verify`, body);
|
|
715
|
+
}
|
|
493
716
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
717
|
+
async function enrollMFAAuthenticatorAppForLoginV2(body) {
|
|
718
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/authenticator/enroll/verify`, body);
|
|
719
|
+
return generateLoginResponseV3(data);
|
|
720
|
+
}
|
|
497
721
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
722
|
+
async function verifyMFAAuthenticatorAppForLogin(deviceId, body) {
|
|
723
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/authenticator/${deviceId}/verify`, body);
|
|
724
|
+
}
|
|
501
725
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
726
|
+
async function preVerifyMFAEmailCode(body) {
|
|
727
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/emailcode`, body);
|
|
728
|
+
}
|
|
505
729
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
730
|
+
async function verifyMFAEmailCode(body) {
|
|
731
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/emailcode/verify`, body);
|
|
732
|
+
}
|
|
509
733
|
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
roleIds
|
|
515
|
-
});
|
|
516
|
-
};
|
|
734
|
+
async function verifyMFAEmailCodeV2(body) {
|
|
735
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/emailcode/verify`, body);
|
|
736
|
+
return generateLoginResponseV3(data);
|
|
737
|
+
}
|
|
517
738
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
}) => {
|
|
522
|
-
return this.post(`${_constants2.urls.team.sso.v2}/saml/configurations/groups`, {
|
|
523
|
-
group,
|
|
524
|
-
roleIds
|
|
525
|
-
});
|
|
526
|
-
};
|
|
739
|
+
async function preEnrollMFASMSForLogin(body) {
|
|
740
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/sms/enroll`, body);
|
|
741
|
+
}
|
|
527
742
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
id
|
|
532
|
-
}) => {
|
|
533
|
-
return this.patch(`${_constants2.urls.team.sso.v2}/saml/configurations/groups/${id}`, {
|
|
534
|
-
group,
|
|
535
|
-
roleIds
|
|
536
|
-
});
|
|
537
|
-
};
|
|
743
|
+
async function enrollMFASMSForLogin(body) {
|
|
744
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/sms/enroll/verify`, body);
|
|
745
|
+
}
|
|
538
746
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
};
|
|
747
|
+
async function enrollMFASMSForLoginV2(body) {
|
|
748
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/sms/enroll/verify`, body);
|
|
749
|
+
return generateLoginResponseV3(data);
|
|
750
|
+
}
|
|
544
751
|
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
752
|
+
async function preVerifyMFASMSForLogin(deviceId, body) {
|
|
753
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/sms/${deviceId}`, body);
|
|
754
|
+
}
|
|
548
755
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
756
|
+
async function verifyMFASMSForLogin(deviceId, body) {
|
|
757
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/sms/${deviceId}/verify`, body);
|
|
758
|
+
}
|
|
552
759
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
760
|
+
async function verifyMFASMSForLoginV2(deviceId, body) {
|
|
761
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/sms/${deviceId}/verify`, body);
|
|
762
|
+
return generateLoginResponseV3(data);
|
|
763
|
+
}
|
|
556
764
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
765
|
+
async function preEnrollMFAWebAuthnForLogin(body) {
|
|
766
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/webauthn/enroll`, body);
|
|
767
|
+
}
|
|
560
768
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
769
|
+
async function enrollMFAWebAuthnForLogin(body) {
|
|
770
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/webauthn/enroll/verify`, body);
|
|
771
|
+
}
|
|
564
772
|
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
773
|
+
async function enrollMFAWebAuthnForLoginV2(body) {
|
|
774
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/webauthn/enroll/verify`, body);
|
|
775
|
+
return generateLoginResponseV3(data);
|
|
776
|
+
}
|
|
568
777
|
|
|
569
|
-
|
|
570
|
-
|
|
778
|
+
async function preVerifyMFAWebAuthnForLogin(deviceId, body) {
|
|
779
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/webauthn/${deviceId}`, body);
|
|
780
|
+
}
|
|
571
781
|
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
782
|
+
async function verifyMFAWebAuthnForLogin(deviceId, body) {
|
|
783
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/webauthn/${deviceId}/verify`, body);
|
|
784
|
+
}
|
|
575
785
|
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
786
|
+
async function verifyMFAWebAuthnForLoginV2(deviceId, body) {
|
|
787
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/mfa/webauthn/${deviceId}/verify`, body);
|
|
788
|
+
return generateLoginResponseV3(data);
|
|
789
|
+
}
|
|
579
790
|
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
791
|
+
async function getSamlConfiguration() {
|
|
792
|
+
return (0, _fetch.Get)(`${_constants2.urls.team.sso.v1}/saml/configurations`);
|
|
793
|
+
}
|
|
583
794
|
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
795
|
+
async function updateSamlConfiguration(body) {
|
|
796
|
+
return (0, _fetch.Post)(`${_constants2.urls.team.sso.v1}/saml/configurations`, body);
|
|
797
|
+
}
|
|
587
798
|
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
799
|
+
async function getSamlVendorConfiguration() {
|
|
800
|
+
return (0, _fetch.Get)(`${_constants2.urls.team.sso.v1}/saml/configurations/vendor-config`);
|
|
801
|
+
}
|
|
591
802
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
}, {
|
|
596
|
-
params: queryParams
|
|
597
|
-
});
|
|
598
|
-
};
|
|
803
|
+
async function updateSamlVendorMetadata(body) {
|
|
804
|
+
return (0, _fetch.Put)(`${_constants2.urls.team.sso.v1}/saml/configurations/metadata`, body);
|
|
805
|
+
}
|
|
599
806
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
807
|
+
async function validateSamlDomain() {
|
|
808
|
+
return (0, _fetch.Put)(`${_constants2.urls.team.sso.v1}/saml/validations/domain`);
|
|
809
|
+
}
|
|
603
810
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
authResponse,
|
|
608
|
-
userId,
|
|
609
|
-
tenantId
|
|
610
|
-
} = await this.post(`${_constants2.urls.identity.users.v1}/signUp`, body);
|
|
611
|
-
const response = {
|
|
612
|
-
shouldActivate,
|
|
613
|
-
userId,
|
|
614
|
-
tenantId
|
|
615
|
-
};
|
|
616
|
-
|
|
617
|
-
if (!shouldActivate && authResponse) {
|
|
618
|
-
const {
|
|
619
|
-
user,
|
|
620
|
-
tenants,
|
|
621
|
-
activeTenant
|
|
622
|
-
} = await this.generateLoginResponseV3(authResponse);
|
|
623
|
-
return (0, _extends2.default)({}, response, {
|
|
624
|
-
user,
|
|
625
|
-
tenants,
|
|
626
|
-
activeTenant
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
return response;
|
|
631
|
-
};
|
|
811
|
+
async function getSamlRoles() {
|
|
812
|
+
return (0, _fetch.Get)(`${_constants2.urls.team.sso.v1}/saml/configurations/roles/default`);
|
|
813
|
+
}
|
|
632
814
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
815
|
+
async function getSamlRolesGroups() {
|
|
816
|
+
return (0, _fetch.Get)(`${_constants2.urls.team.sso.v2}/saml/configurations/groups`);
|
|
817
|
+
}
|
|
636
818
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
819
|
+
async function updateSamlRoles({
|
|
820
|
+
roleIds
|
|
821
|
+
}) {
|
|
822
|
+
return (0, _fetch.Post)(`${_constants2.urls.team.sso.v1}/saml/configurations/roles/default`, {
|
|
823
|
+
roleIds
|
|
824
|
+
});
|
|
825
|
+
}
|
|
640
826
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
827
|
+
async function createSamlGroup({
|
|
828
|
+
roleIds,
|
|
829
|
+
group
|
|
830
|
+
}) {
|
|
831
|
+
return (0, _fetch.Post)(`${_constants2.urls.team.sso.v2}/saml/configurations/groups`, {
|
|
832
|
+
group,
|
|
833
|
+
roleIds
|
|
834
|
+
});
|
|
835
|
+
}
|
|
646
836
|
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
837
|
+
async function updateSamlGroup({
|
|
838
|
+
roleIds,
|
|
839
|
+
group,
|
|
840
|
+
id
|
|
841
|
+
}) {
|
|
842
|
+
return (0, _fetch.Patch)(`${_constants2.urls.team.sso.v2}/saml/configurations/groups/${id}`, {
|
|
843
|
+
group,
|
|
844
|
+
roleIds
|
|
845
|
+
});
|
|
846
|
+
}
|
|
650
847
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
848
|
+
async function deleteSamlGroup({
|
|
849
|
+
id
|
|
850
|
+
}) {
|
|
851
|
+
return (0, _fetch.Delete)(`${_constants2.urls.team.sso.v2}/saml/configurations/groups/${id}`);
|
|
852
|
+
}
|
|
654
853
|
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
854
|
+
async function getOidcConfiguration() {
|
|
855
|
+
return (0, _fetch.Get)(`${_constants2.urls.team.sso.v1}/oidc/configurations`);
|
|
856
|
+
}
|
|
658
857
|
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
858
|
+
async function getSSOPublicConfiguration() {
|
|
859
|
+
return (0, _fetch.Get)(`${_constants2.urls.team.sso.v2}/configurations/public`);
|
|
860
|
+
}
|
|
662
861
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
862
|
+
async function getSocialLoginProviders() {
|
|
863
|
+
return (0, _fetch.Get)(_constants2.urls.identity.sso.v1);
|
|
864
|
+
}
|
|
666
865
|
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
866
|
+
async function getSocialLoginProvidersV2() {
|
|
867
|
+
return (0, _fetch.Get)(_constants2.urls.identity.sso.v2);
|
|
868
|
+
}
|
|
670
869
|
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
await this.delete(`${_constants2.urls.identity.tenants.accessTokens.v1}/${id}`);
|
|
675
|
-
};
|
|
870
|
+
async function getSocialLoginProvidersV2ForAuthenticatedUser() {
|
|
871
|
+
return (0, _fetch.Get)(`${_constants2.urls.identity.sso.v2}/authenticated`);
|
|
872
|
+
}
|
|
676
873
|
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
await this.delete(`${_constants2.urls.identity.users.accessTokens.v1}/${id}`);
|
|
681
|
-
};
|
|
874
|
+
async function getCustomSocialLoginProvidersV1() {
|
|
875
|
+
return (0, _fetch.Get)(_constants2.urls.identity.sso.custom.v1);
|
|
876
|
+
}
|
|
682
877
|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
878
|
+
async function loginViaSocialLogin({
|
|
879
|
+
provider,
|
|
880
|
+
code,
|
|
881
|
+
idToken,
|
|
882
|
+
redirectUri,
|
|
883
|
+
codeVerifier,
|
|
884
|
+
metadata,
|
|
885
|
+
invitationToken,
|
|
886
|
+
state
|
|
887
|
+
}) {
|
|
888
|
+
const params = {};
|
|
889
|
+
|
|
890
|
+
if (code) {
|
|
891
|
+
params.code = code;
|
|
892
|
+
}
|
|
686
893
|
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
894
|
+
if (idToken) {
|
|
895
|
+
params.id_token = idToken;
|
|
896
|
+
}
|
|
690
897
|
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
898
|
+
if (redirectUri) {
|
|
899
|
+
params.redirectUri = redirectUri;
|
|
900
|
+
}
|
|
694
901
|
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
902
|
+
if (codeVerifier) {
|
|
903
|
+
params.code_verifier = codeVerifier;
|
|
904
|
+
}
|
|
698
905
|
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
906
|
+
if (state) {
|
|
907
|
+
params.state = state;
|
|
908
|
+
}
|
|
702
909
|
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
910
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/sso/${provider}/postlogin`, {
|
|
911
|
+
metadata,
|
|
912
|
+
invitationToken
|
|
913
|
+
}, {
|
|
914
|
+
params
|
|
915
|
+
});
|
|
916
|
+
}
|
|
706
917
|
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
await this.delete(`${_constants2.urls.identity.tenants.apiTokens.v1}/${tokenId}`);
|
|
711
|
-
};
|
|
918
|
+
async function getVendorConfig() {
|
|
919
|
+
return (0, _fetch.Get)(`${_constants2.urls.identity.configurations.v1}/public`);
|
|
920
|
+
}
|
|
712
921
|
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
922
|
+
async function signUpUser(body) {
|
|
923
|
+
const {
|
|
924
|
+
shouldActivate,
|
|
925
|
+
authResponse,
|
|
926
|
+
userId,
|
|
927
|
+
tenantId
|
|
928
|
+
} = await (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/signUp`, body);
|
|
929
|
+
const response = {
|
|
930
|
+
shouldActivate,
|
|
931
|
+
userId,
|
|
932
|
+
tenantId
|
|
933
|
+
};
|
|
934
|
+
|
|
935
|
+
if (!shouldActivate && authResponse) {
|
|
936
|
+
const {
|
|
937
|
+
user,
|
|
938
|
+
tenants,
|
|
939
|
+
activeTenant
|
|
940
|
+
} = await generateLoginResponseV3(authResponse);
|
|
941
|
+
return (0, _extends2.default)({}, response, {
|
|
942
|
+
user,
|
|
943
|
+
tenants,
|
|
944
|
+
activeTenant
|
|
945
|
+
});
|
|
946
|
+
}
|
|
718
947
|
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}) => {
|
|
722
|
-
return this.get(`${_constants2.urls.identity.users.v1}/${userId}`);
|
|
723
|
-
};
|
|
948
|
+
return response;
|
|
949
|
+
}
|
|
724
950
|
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
});
|
|
729
|
-
};
|
|
951
|
+
async function getCurrentUserSessions() {
|
|
952
|
+
return (0, _fetch.Get)(_constants2.urls.identity.users.sessions.currentUser.v1);
|
|
953
|
+
}
|
|
730
954
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
} = _ref,
|
|
735
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
736
|
-
return this.post(`${_constants2.urls.identity.auth.v1}/passwordless/${type.toLocaleLowerCase()}/prelogin`, body);
|
|
737
|
-
};
|
|
955
|
+
async function getCurrentUserSession() {
|
|
956
|
+
return (0, _fetch.Get)(`${_constants2.urls.identity.users.sessions.currentUser.v1}/current`);
|
|
957
|
+
}
|
|
738
958
|
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
const data = await this.post(`${_constants2.urls.identity.auth.v1}/passwordless/${type.toLocaleLowerCase()}/postlogin`, body);
|
|
745
|
-
return this.generateLoginResponseV3(data);
|
|
746
|
-
};
|
|
959
|
+
async function revokeSessionsForUser(userId) {
|
|
960
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.sessions.v1}/revoke`, {
|
|
961
|
+
userId
|
|
962
|
+
});
|
|
963
|
+
}
|
|
747
964
|
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
} = _ref3,
|
|
752
|
-
body = (0, _objectWithoutPropertiesLoose2.default)(_ref3, _excluded3);
|
|
753
|
-
return this.post(`${_constants2.urls.identity.auth.v1}/passwordless/${type.toLocaleLowerCase()}/postlogin`, body);
|
|
754
|
-
};
|
|
965
|
+
async function getSessionConfigurations() {
|
|
966
|
+
return (0, _fetch.Get)(_constants2.urls.identity.users.sessions.configurations.v1);
|
|
967
|
+
}
|
|
755
968
|
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
return this.post(_constants2.urls.identity.tenants.invites.verify.v1, {
|
|
760
|
-
token
|
|
761
|
-
});
|
|
762
|
-
};
|
|
969
|
+
async function createOrUpdateSessionConfigrations(body) {
|
|
970
|
+
await (0, _fetch.Post)(_constants2.urls.identity.users.sessions.configurations.v1, body);
|
|
971
|
+
}
|
|
763
972
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
973
|
+
async function deleteSessionForUser(id) {
|
|
974
|
+
await (0, _fetch.Delete)(`${_constants2.urls.identity.users.sessions.currentUser.v1}/${id}`);
|
|
975
|
+
}
|
|
767
976
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
977
|
+
async function deleteAllSessionsForUser() {
|
|
978
|
+
await (0, _fetch.Delete)(`${_constants2.urls.identity.users.sessions.currentUser.v1}/all`);
|
|
979
|
+
}
|
|
771
980
|
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
981
|
+
async function getUserAccessTokensData() {
|
|
982
|
+
return (0, _fetch.Get)(_constants2.urls.identity.users.accessTokens.v1);
|
|
983
|
+
}
|
|
775
984
|
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
985
|
+
async function getTenantAccessTokensData() {
|
|
986
|
+
return (0, _fetch.Get)(_constants2.urls.identity.tenants.accessTokens.v1);
|
|
987
|
+
}
|
|
779
988
|
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
989
|
+
async function deleteTenantAccessToken({
|
|
990
|
+
id
|
|
991
|
+
}) {
|
|
992
|
+
return (0, _fetch.Delete)(`${_constants2.urls.identity.tenants.accessTokens.v1}/${id}`);
|
|
993
|
+
}
|
|
783
994
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
995
|
+
async function deleteUserAccessToken({
|
|
996
|
+
id
|
|
997
|
+
}) {
|
|
998
|
+
return (0, _fetch.Delete)(`${_constants2.urls.identity.users.accessTokens.v1}/${id}`);
|
|
999
|
+
}
|
|
787
1000
|
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
1001
|
+
async function createUserAccessToken(body) {
|
|
1002
|
+
return (0, _fetch.Post)(_constants2.urls.identity.users.accessTokens.v1, body);
|
|
1003
|
+
}
|
|
791
1004
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
1005
|
+
async function createTenantAccessToken(body) {
|
|
1006
|
+
return (0, _fetch.Post)(_constants2.urls.identity.tenants.accessTokens.v1, body);
|
|
1007
|
+
}
|
|
795
1008
|
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
1009
|
+
async function getUserApiTokensData() {
|
|
1010
|
+
return (0, _fetch.Get)(_constants2.urls.identity.users.apiTokens.v1);
|
|
1011
|
+
}
|
|
799
1012
|
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
1013
|
+
async function getTenantApiTokensData() {
|
|
1014
|
+
return (0, _fetch.Get)(_constants2.urls.identity.tenants.apiTokens.v1);
|
|
1015
|
+
}
|
|
803
1016
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
1017
|
+
async function updateUserApiTokensData(body) {
|
|
1018
|
+
return (0, _fetch.Post)(_constants2.urls.identity.users.apiTokens.v1, body);
|
|
1019
|
+
}
|
|
807
1020
|
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
1021
|
+
async function updateTenantApiTokensData(body) {
|
|
1022
|
+
return (0, _fetch.Post)(_constants2.urls.identity.tenants.apiTokens.v2, body);
|
|
1023
|
+
}
|
|
811
1024
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
1025
|
+
async function deleteTenantApiToken({
|
|
1026
|
+
tokenId
|
|
1027
|
+
}) {
|
|
1028
|
+
return (0, _fetch.Delete)(`${_constants2.urls.identity.tenants.apiTokens.v1}/${tokenId}`);
|
|
1029
|
+
}
|
|
815
1030
|
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
1031
|
+
async function deleteUserApiToken({
|
|
1032
|
+
tokenId
|
|
1033
|
+
}) {
|
|
1034
|
+
return (0, _fetch.Delete)(`${_constants2.urls.identity.users.apiTokens.v1}/${tokenId}`);
|
|
1035
|
+
}
|
|
819
1036
|
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
1037
|
+
async function getUserById({
|
|
1038
|
+
userId
|
|
1039
|
+
}) {
|
|
1040
|
+
return (0, _fetch.Get)(`${_constants2.urls.identity.users.v1}/${userId}`);
|
|
1041
|
+
}
|
|
823
1042
|
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
return this.patch(`${_constants2.urls.team.sso.v1}/configurations/${ssoConfigId}/groups/${id}`, {
|
|
830
|
-
group,
|
|
831
|
-
roleIds
|
|
832
|
-
});
|
|
833
|
-
};
|
|
1043
|
+
async function checkIfAllowToRememberMfaDevice(mfaToken) {
|
|
1044
|
+
return (0, _fetch.Get)(`${_constants2.urls.identity.configurations.v1}/mfa-policy/allow-remember-device`, {
|
|
1045
|
+
mfaToken
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
834
1048
|
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
1049
|
+
async function passwordlessPreLogin(_ref) {
|
|
1050
|
+
let {
|
|
1051
|
+
type
|
|
1052
|
+
} = _ref,
|
|
1053
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
1054
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/passwordless/${type.toLocaleLowerCase()}/prelogin`, body);
|
|
1055
|
+
}
|
|
838
1056
|
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
1057
|
+
async function passwordlessPostLoginV2(_ref2) {
|
|
1058
|
+
let {
|
|
1059
|
+
type
|
|
1060
|
+
} = _ref2,
|
|
1061
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded2);
|
|
1062
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/passwordless/${type.toLocaleLowerCase()}/postlogin`, body);
|
|
1063
|
+
return generateLoginResponseV3(data);
|
|
1064
|
+
}
|
|
842
1065
|
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
1066
|
+
async function passwordlessPostLogin(_ref3) {
|
|
1067
|
+
let {
|
|
1068
|
+
type
|
|
1069
|
+
} = _ref3,
|
|
1070
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref3, _excluded3);
|
|
1071
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/passwordless/${type.toLocaleLowerCase()}/postlogin`, body);
|
|
1072
|
+
}
|
|
846
1073
|
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
1074
|
+
async function verifyInviteToken({
|
|
1075
|
+
token
|
|
1076
|
+
}) {
|
|
1077
|
+
return (0, _fetch.Post)(_constants2.urls.identity.tenants.invites.verify.v1, {
|
|
1078
|
+
token
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
851
1081
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
};
|
|
1082
|
+
async function getSSOConfigurations() {
|
|
1083
|
+
return (0, _fetch.Get)(`${_constants2.urls.team.sso.v1}/configurations`);
|
|
1084
|
+
}
|
|
856
1085
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
tenantId: tabTenantId
|
|
861
|
-
});
|
|
862
|
-
return this.generateLoginResponseFromOAuthResponseV2(data);
|
|
863
|
-
};
|
|
1086
|
+
async function createSSOConfiguration(body) {
|
|
1087
|
+
return (0, _fetch.Post)(`${_constants2.urls.team.sso.v1}/configurations`, body);
|
|
1088
|
+
}
|
|
864
1089
|
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
};
|
|
1090
|
+
async function updateSSOConfiguration(ssoConfigId, body) {
|
|
1091
|
+
return (0, _fetch.Patch)(`${_constants2.urls.team.sso.v1}/configurations/${ssoConfigId}`, body);
|
|
1092
|
+
}
|
|
869
1093
|
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
tenantId: tabTenantId
|
|
874
|
-
});
|
|
875
|
-
return this.generateLoginResponseFromOAuthResponse(data);
|
|
876
|
-
};
|
|
1094
|
+
async function deleteSSOConfiguration(ssoConfigId) {
|
|
1095
|
+
return (0, _fetch.Delete)(`${_constants2.urls.team.sso.v1}/configurations/${ssoConfigId}`);
|
|
1096
|
+
}
|
|
877
1097
|
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
1098
|
+
async function createSSOConfigurationByMetadata(body) {
|
|
1099
|
+
return (0, _fetch.Post)(`${_constants2.urls.team.sso.v1}/configurations/metadata`, body);
|
|
1100
|
+
}
|
|
881
1101
|
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
1102
|
+
async function updateSSOConfigurationByMetadata(ssoConfigId, body) {
|
|
1103
|
+
return (0, _fetch.Put)(`${_constants2.urls.team.sso.v1}/configurations/${ssoConfigId}/metadata`, body);
|
|
1104
|
+
}
|
|
885
1105
|
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
1106
|
+
async function createSSOConfigurationByMetadataUrl(body) {
|
|
1107
|
+
return (0, _fetch.Post)(`${_constants2.urls.team.sso.v1}/configurations/metadata-url`, body);
|
|
1108
|
+
}
|
|
889
1109
|
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
1110
|
+
async function updateSSOConfigurationByMetadataUrl(ssoConfigId, body) {
|
|
1111
|
+
return (0, _fetch.Put)(`${_constants2.urls.team.sso.v1}/configurations/${ssoConfigId}/metadata-url`, body);
|
|
1112
|
+
}
|
|
893
1113
|
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1114
|
+
async function createSSODomain(ssoConfigId, body) {
|
|
1115
|
+
return (0, _fetch.Post)(`${_constants2.urls.team.sso.v1}/configurations/${ssoConfigId}/domains`, body);
|
|
1116
|
+
}
|
|
897
1117
|
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
1118
|
+
async function deleteSSODomain(ssoConfigId, domainId) {
|
|
1119
|
+
return (0, _fetch.Delete)(`${_constants2.urls.team.sso.v1}/configurations/${ssoConfigId}/domains/${domainId}`);
|
|
1120
|
+
}
|
|
901
1121
|
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
1122
|
+
async function validateSSODomain(ssoConfigId, domainId) {
|
|
1123
|
+
return (0, _fetch.Put)(`${_constants2.urls.team.sso.v1}/configurations/${ssoConfigId}/domains/${domainId}/validate`);
|
|
1124
|
+
}
|
|
905
1125
|
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
};
|
|
1126
|
+
async function validateSSODomainV2(ssoConfigId, domainId) {
|
|
1127
|
+
return (0, _fetch.Put)(`${_constants2.urls.team.sso.v2}/configurations/${ssoConfigId}/domains/${domainId}/validate`);
|
|
1128
|
+
}
|
|
910
1129
|
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
1130
|
+
async function getSSODefaultRoles(ssoConfigId) {
|
|
1131
|
+
return (0, _fetch.Get)(`${_constants2.urls.team.sso.v1}/configurations/${ssoConfigId}/roles`);
|
|
1132
|
+
}
|
|
914
1133
|
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
1134
|
+
async function setSSODefaultRoles(ssoConfigId, body) {
|
|
1135
|
+
return (0, _fetch.Put)(`${_constants2.urls.team.sso.v1}/configurations/${ssoConfigId}/roles`, body);
|
|
1136
|
+
}
|
|
918
1137
|
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
1138
|
+
async function createSSOGroup(ssoConfigId, body) {
|
|
1139
|
+
return (0, _fetch.Post)(`${_constants2.urls.team.sso.v1}/configurations/${ssoConfigId}/groups`, body);
|
|
1140
|
+
}
|
|
922
1141
|
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1142
|
+
async function updateSSOGroup(ssoConfigId, {
|
|
1143
|
+
roleIds,
|
|
1144
|
+
group,
|
|
1145
|
+
id
|
|
1146
|
+
}) {
|
|
1147
|
+
return (0, _fetch.Patch)(`${_constants2.urls.team.sso.v1}/configurations/${ssoConfigId}/groups/${id}`, {
|
|
1148
|
+
group,
|
|
1149
|
+
roleIds
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
926
1152
|
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
1153
|
+
async function deleteSSOGroup(ssoConfigId, groupId) {
|
|
1154
|
+
return (0, _fetch.Delete)(`${_constants2.urls.team.sso.v1}/configurations/${ssoConfigId}/groups/${groupId}`);
|
|
1155
|
+
}
|
|
930
1156
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
1157
|
+
async function getSSOGroups(ssoConfigId) {
|
|
1158
|
+
return (0, _fetch.Get)(`${_constants2.urls.team.sso.v1}/configurations/${ssoConfigId}/groups`);
|
|
1159
|
+
}
|
|
934
1160
|
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
1161
|
+
async function preLoginV2(body) {
|
|
1162
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v2}/user/sso/prelogin`, body);
|
|
1163
|
+
}
|
|
938
1164
|
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
1165
|
+
async function oidcPostLoginV2(body) {
|
|
1166
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v2}/user/oidc/postlogin`, body);
|
|
1167
|
+
return generateLoginResponse(data);
|
|
1168
|
+
}
|
|
942
1169
|
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
1170
|
+
async function exchangeOAuthTokensV2(body) {
|
|
1171
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.oauth.v1}/token`, body);
|
|
1172
|
+
return generateLoginResponseFromOAuthResponseV2(data);
|
|
1173
|
+
}
|
|
946
1174
|
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
1175
|
+
async function silentOAuthRefreshTokenV2() {
|
|
1176
|
+
const tabTenantId = (0, _utils.getTabTenantFromSessionStorage)();
|
|
1177
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.oauth.v1}/authorize/silent`, {
|
|
1178
|
+
tenantId: tabTenantId
|
|
1179
|
+
});
|
|
1180
|
+
return generateLoginResponseFromOAuthResponseV2(data);
|
|
1181
|
+
}
|
|
952
1182
|
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
}, {
|
|
958
|
-
action: this.noThrowLoadEntitlements,
|
|
959
|
-
shouldLoad: this.shouldLoadEntitlements()
|
|
960
|
-
}, {
|
|
961
|
-
action: this.getUserAuthorization,
|
|
962
|
-
shouldLoad: this.shouldLoadMeAuthorization()
|
|
963
|
-
}];
|
|
964
|
-
const promises = actions.map(action => (0, _utils.executeConditionalPromise)(action));
|
|
965
|
-
const [me, entitlements, authorization] = await Promise.all(promises);
|
|
966
|
-
const tabTenant = (0, _utils.getTabTenantFromSessionStorage)(this.appName);
|
|
967
|
-
|
|
968
|
-
if (tabTenant) {
|
|
969
|
-
me.tenantId = tabTenant;
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
return (0, _extends2.default)({}, me, authorization != null ? authorization : {}, {
|
|
973
|
-
entitlements
|
|
974
|
-
});
|
|
975
|
-
};
|
|
1183
|
+
async function exchangeOAuthTokens(body) {
|
|
1184
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.oauth.v1}/token`, body);
|
|
1185
|
+
return generateLoginResponseFromOAuthResponse(data);
|
|
1186
|
+
}
|
|
976
1187
|
|
|
977
|
-
|
|
978
|
-
|
|
1188
|
+
async function silentOAuthRefreshToken() {
|
|
1189
|
+
const tabTenantId = (0, _utils.getTabTenantFromSessionStorage)();
|
|
1190
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.oauth.v1}/authorize/silent`, {
|
|
1191
|
+
tenantId: tabTenantId
|
|
1192
|
+
});
|
|
1193
|
+
return generateLoginResponseFromOAuthResponse(data);
|
|
1194
|
+
}
|
|
979
1195
|
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
1196
|
+
async function resetPhoneNumber(body) {
|
|
1197
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/phone/reset`, body);
|
|
1198
|
+
}
|
|
983
1199
|
|
|
984
|
-
|
|
985
|
-
|
|
1200
|
+
async function verifyResetPhoneNumber(body) {
|
|
1201
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/phone/reset/verify`, body);
|
|
1202
|
+
}
|
|
986
1203
|
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
this.saveMfaPolicy = this.securityPolicy.saveMfaPolicy.bind(this.securityPolicy);
|
|
991
|
-
this.getLockoutPolicy = this.securityPolicy.getLockoutPolicy.bind(this.securityPolicy);
|
|
992
|
-
this.getVendorLockoutPolicy = this.securityPolicy.getVendorLockoutPolicy.bind(this.securityPolicy);
|
|
993
|
-
this.saveLockoutPolicy = this.securityPolicy.saveLockoutPolicy.bind(this.securityPolicy);
|
|
994
|
-
this.getCaptchaPolicy = this.securityPolicy.getCaptchaPolicy.bind(this.securityPolicy);
|
|
995
|
-
this.getPasswordHistoryPolicy = this.securityPolicy.getPasswordHistoryPolicy.bind(this.securityPolicy);
|
|
996
|
-
this.getVendorPasswordHistoryPolicy = this.securityPolicy.getVendorPasswordHistoryPolicy.bind(this.securityPolicy);
|
|
997
|
-
this.savePasswordHistoryPolicy = this.securityPolicy.savePasswordHistoryPolicy.bind(this.securityPolicy);
|
|
998
|
-
this.getPasswordConfigPolicy = this.securityPolicy.getPasswordConfigPolicy.bind(this.securityPolicy);
|
|
999
|
-
this.getDomainRestrictions = this.securityPolicy.getDomainRestrictions.bind(this.securityPolicy);
|
|
1000
|
-
this.getDomainRestrictionsConfig = this.securityPolicy.getDomainRestrictionsConfig.bind(this.securityPolicy);
|
|
1001
|
-
this.createDomainRestriction = this.securityPolicy.createDomainRestriction.bind(this.securityPolicy);
|
|
1002
|
-
this.updateDomainRestrictionConfig = this.securityPolicy.updateDomainRestrictionConfig.bind(this.securityPolicy);
|
|
1003
|
-
this.deleteDomainRestriction = this.securityPolicy.deleteDomainRestriction.bind(this.securityPolicy);
|
|
1004
|
-
this.getIPRestrictions = this.securityPolicy.getIPRestrictions.bind(this.securityPolicy);
|
|
1005
|
-
this.getIPRestrictionsConfig = this.securityPolicy.getIPRestrictionsConfig.bind(this.securityPolicy);
|
|
1006
|
-
this.createIPRestriction = this.securityPolicy.createIPRestriction.bind(this.securityPolicy);
|
|
1007
|
-
this.bulkCreateIPRestriction = this.securityPolicy.bulkCreateIPRestriction.bind(this.securityPolicy);
|
|
1008
|
-
this.updateIPRestrictionConfig = this.securityPolicy.updateIPRestrictionConfig.bind(this.securityPolicy);
|
|
1009
|
-
this.deleteIPRestriction = this.securityPolicy.deleteIPRestriction.bind(this.securityPolicy);
|
|
1010
|
-
this.testCurrentIp = this.securityPolicy.testCurrentIp.bind(this.securityPolicy);
|
|
1011
|
-
this.testCurrentIpInAllowList = this.securityPolicy.testCurrentIpInAllowList.bind(this.securityPolicy);
|
|
1012
|
-
}
|
|
1204
|
+
async function changePhoneNumberWithVerification(body) {
|
|
1205
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/phone`, body);
|
|
1206
|
+
}
|
|
1013
1207
|
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
}
|
|
1208
|
+
async function verifyChangePhoneNumber(body) {
|
|
1209
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.users.v1}/phone/verify`, body);
|
|
1210
|
+
}
|
|
1018
1211
|
|
|
1019
|
-
|
|
1212
|
+
async function changePhoneNumber(body) {
|
|
1213
|
+
return (0, _fetch.Put)(`${_constants2.urls.identity.users.v1}/phone/change`, body);
|
|
1214
|
+
}
|
|
1020
1215
|
|
|
1021
|
-
|
|
1022
|
-
}
|
|
1216
|
+
async function webAuthnPreLogin(body) {
|
|
1217
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/webauthn/prelogin`, body);
|
|
1218
|
+
}
|
|
1023
1219
|
|
|
1024
|
-
|
|
1025
|
-
|
|
1220
|
+
async function webAuthnPostLogin(body) {
|
|
1221
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/webauthn/postlogin`, body);
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
async function webAuthnPostLoginV2(body) {
|
|
1225
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/webauthn/postlogin`, body);
|
|
1226
|
+
return generateLoginResponseV3(data);
|
|
1227
|
+
}
|
|
1026
1228
|
|
|
1027
|
-
|
|
1229
|
+
async function webAuthnCreateNewDeviceSession() {
|
|
1230
|
+
return (0, _fetch.Post)(_constants2.urls.identity.webAuthnDevices.v1);
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
async function getWebAuthnDevices() {
|
|
1234
|
+
return (0, _fetch.Get)(_constants2.urls.identity.webAuthnDevices.v1);
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
async function deleteWebAuthnDevice(deviceId) {
|
|
1238
|
+
return (0, _fetch.Delete)(`${_constants2.urls.identity.webAuthnDevices.v1}/${deviceId}`);
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
async function verifyNewDeviceSession(body) {
|
|
1242
|
+
return (0, _fetch.Post)(`${_constants2.urls.identity.webAuthnDevices.v1}/verify`, body);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
async function getVendorPublicAuthStrategiesConfig() {
|
|
1246
|
+
return (0, _fetch.Get)(`${_constants2.urls.identity.configurations.v1}/auth/strategies/public`);
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
async function getPublicAuthStrategiesConfigForAuthenticatedUser() {
|
|
1250
|
+
return (0, _fetch.Get)(`${_constants2.urls.identity.configurations.v1}/auth/strategies`);
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
async function getMFAStrategiesConfig() {
|
|
1254
|
+
return (0, _fetch.Get)(`${_constants2.urls.identity.configurations.v1}/mfa/strategies`);
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
async function getUserAuthorization() {
|
|
1258
|
+
return (0, _fetch.Get)(`${_constants2.urls.identity.users.authorization.v1}`);
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
async function getMeV2() {
|
|
1262
|
+
return (0, _fetch.Get)(`${_constants2.urls.identity.users.v2}/me`);
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
const noThrowLoadEntitlements = async () => {
|
|
1266
|
+
try {
|
|
1267
|
+
return await (0, _entitlements.loadEntitlementsV2)();
|
|
1268
|
+
} catch (e) {}
|
|
1269
|
+
};
|
|
1270
|
+
|
|
1271
|
+
async function getMeAndEntitlements() {
|
|
1272
|
+
const actions = [{
|
|
1273
|
+
action: getMeV2,
|
|
1274
|
+
shouldLoad: true
|
|
1275
|
+
}, {
|
|
1276
|
+
action: noThrowLoadEntitlements,
|
|
1277
|
+
shouldLoad: shouldLoadEntitlements()
|
|
1278
|
+
}, {
|
|
1279
|
+
action: getUserAuthorization,
|
|
1280
|
+
shouldLoad: shouldLoadMeAuthorization()
|
|
1281
|
+
}];
|
|
1282
|
+
const promises = actions.map(action => (0, _utils.executeConditionalPromise)(action));
|
|
1283
|
+
const [me, entitlements, authorization] = await Promise.all(promises);
|
|
1284
|
+
const tabTenant = (0, _utils.getTabTenantFromSessionStorage)();
|
|
1285
|
+
|
|
1286
|
+
if (tabTenant) {
|
|
1287
|
+
me.tenantId = tabTenant;
|
|
1028
1288
|
}
|
|
1029
1289
|
|
|
1290
|
+
return (0, _extends2.default)({}, me, authorization != null ? authorization : {}, {
|
|
1291
|
+
entitlements
|
|
1292
|
+
});
|
|
1030
1293
|
}
|
|
1031
1294
|
|
|
1032
|
-
|
|
1295
|
+
async function generateStepupSession(body) {
|
|
1296
|
+
const data = await (0, _fetch.Post)(`${_constants2.urls.identity.auth.v1}/user/step-up/generate`, body);
|
|
1033
1297
|
|
|
1034
|
-
|
|
1298
|
+
if (!data.accessToken) {
|
|
1299
|
+
return data;
|
|
1300
|
+
}
|
|
1035
1301
|
|
|
1036
|
-
|
|
1302
|
+
return generateLoginResponseV3(data);
|
|
1303
|
+
}
|