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