@frontegg/rest-api 3.0.34 → 3.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/index.d.ts +58 -1
- package/auth/index.js +33 -0
- package/auth/interfaces.d.ts +88 -0
- package/auth/interfaces.js +17 -1
- package/index.js +1 -1
- package/node/auth/index.js +66 -0
- package/node/auth/interfaces.js +23 -3
- package/node/index.js +1 -1
- package/package.json +1 -1
package/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './secutiry-poilicy';
|
|
2
2
|
export * from './enums';
|
|
3
3
|
import { ISamlRolesGroup } from '../teams/interfaces';
|
|
4
|
-
import { IAcceptInvitation, IActivateAccount, IAllowedToRememberMfaDevice, ICreateSamlGroup, IDeleteApiToken, IDisableMfa, IEnrollMfaResponse, IForgotPassword, IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse, IGetUserById, IGetUserPasswordConfig, ILogin, ILoginResponse, ILoginViaSocialLogin, ILoginViaSocialLoginResponse, ILoginWithMfa, IOidcPostLogin, IOidcConfiguration, IPostLogin, IPreLogin, IRecoverMFAToken, IResendActivationEmail, IResetPassword, ISamlConfiguration, ISamlVendorConfigResponse, ISignUpResponse, ISignUpUser, ISocialLoginProviderConfiguration, ITenantApiTokensData, IUpdateSamlConfiguration, IUpdateSamlGroup, IUpdateSamlRoles, IUpdateSamlVendorMetadata, IUpdateTenantApiTokensData, IUpdateUserApiTokensData, IUserApiTokensData, IUserIdResponse, IVendorConfig, IVerifyMfa, IVerifyMfaResponse, TestConfig, ISSOPublicConfiguration, IPreLoginWithIdpTypeResponse, IPasswordlessPreLogin, IPasswordlessPostLogin, ICreateSSODomain, IVerifyInviteToken, ISSODomain, ISSOConfigurationDefaultRoles, ISSOConfiguration, IUpdateSSOConfiguration, IOidcPostLoginV2, IExchangeOAuthTokens, IOAuthTokenResponse, ISocialLoginProviderConfigurationV2, ILoginResponseV2, IResetPhoneNumber, IVerifyResetPhoneNumber, IChangePhoneNumber, IVerifyResetPhoneNumberResponse, IResetPhoneNumberResponse, IWebAuthnPreLogin, IWebAuthnPostLogin, IVerifyNewWebAuthnDevice, IWebAuthnPreLoginResponse, ICreateNewDeviceSessionResponse, IAuthStrategiesConfig, ISessionResponse, IChangePhoneNumberWithVerification, IChangePhoneNumberWithVerificationResponse, IVerifyChangePhoneNumber, ISessionConfigurations, IResendInvitationEmail } from './interfaces';
|
|
4
|
+
import { IAcceptInvitation, IActivateAccount, IAllowedToRememberMfaDevice, ICreateSamlGroup, IDeleteApiToken, IDisableMfa, IEnrollMfaResponse, IForgotPassword, IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse, IGetUserById, IGetUserPasswordConfig, ILogin, ILoginResponse, ILoginViaSocialLogin, ILoginViaSocialLoginResponse, ILoginWithMfa, IOidcPostLogin, IOidcConfiguration, IPostLogin, IPreLogin, IRecoverMFAToken, IResendActivationEmail, IResetPassword, ISamlConfiguration, ISamlVendorConfigResponse, ISignUpResponse, ISignUpUser, ISocialLoginProviderConfiguration, ITenantApiTokensData, IUpdateSamlConfiguration, IUpdateSamlGroup, IUpdateSamlRoles, IUpdateSamlVendorMetadata, IUpdateTenantApiTokensData, IUpdateUserApiTokensData, IUserApiTokensData, IUserIdResponse, IVendorConfig, IVerifyMfa, IVerifyMfaResponse, TestConfig, ISSOPublicConfiguration, IPreLoginWithIdpTypeResponse, IPasswordlessPreLogin, IPasswordlessPostLogin, ICreateSSODomain, IVerifyInviteToken, ISSODomain, ISSOConfigurationDefaultRoles, ISSOConfiguration, IUpdateSSOConfiguration, IOidcPostLoginV2, IExchangeOAuthTokens, IOAuthTokenResponse, ISocialLoginProviderConfigurationV2, ILoginResponseV2, IResetPhoneNumber, IVerifyResetPhoneNumber, IChangePhoneNumber, IVerifyResetPhoneNumberResponse, IResetPhoneNumberResponse, IWebAuthnPreLogin, IWebAuthnPostLogin, IVerifyNewWebAuthnDevice, IWebAuthnPreLoginResponse, ICreateNewDeviceSessionResponse, IAuthStrategiesConfig, ISessionResponse, IChangePhoneNumberWithVerification, IChangePhoneNumberWithVerificationResponse, IVerifyChangePhoneNumber, ISessionConfigurations, IResendInvitationEmail, IPreEnrollMFA, IEnrollMFAAuthenticatorApp, IPreEnrollMFASMS, IEnrollMFASMS, IEnrollMFAWebAuthn, IPreEnrollMFAAuthenticatorAppResponse, IPreEnrollMFAWebAuthnResponse, IVerifyMFAAuthenticatorApp, IPreVerifyMFA, IPreVerifyMFASMSResponse, IVerifyMFASMS, IPreVerifyMFAWebAuthnResponse, IVerifyMFAWebAuthn } from './interfaces';
|
|
5
5
|
/*****************************************
|
|
6
6
|
* Authentication
|
|
7
7
|
*****************************************/
|
|
@@ -145,6 +145,63 @@ export declare function verifyMfa(body: IVerifyMfa): Promise<IVerifyMfaResponse>
|
|
|
145
145
|
* * ``authorized user``
|
|
146
146
|
*/
|
|
147
147
|
export declare function disableMfa(body: IDisableMfa): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* pre enroll Multi-Factor Auth Code to use in 3rd party apps like Google Authenticator.
|
|
150
|
+
* the server returns qrCode as png image in base64 format
|
|
151
|
+
*/
|
|
152
|
+
export declare function preEnrollMFAAuthenticatorAppForLogin(body: IPreEnrollMFA): Promise<IPreEnrollMFAAuthenticatorAppResponse>;
|
|
153
|
+
/**
|
|
154
|
+
* after pre enroll with authenticator app, enroll authenticator app function should be called
|
|
155
|
+
* with the generated code in the Authenticator App
|
|
156
|
+
*/
|
|
157
|
+
export declare function enrollMFAAuthenticatorAppForLogin(body: IEnrollMFAAuthenticatorApp): Promise<ILoginResponse>;
|
|
158
|
+
/**
|
|
159
|
+
* after login succeeded with mfaRequired token response, this function should be called
|
|
160
|
+
* with the selected authenticator app id, mfaToken and the generated code from your authenticator app.
|
|
161
|
+
*/
|
|
162
|
+
export declare function verifyMFAAuthenticatorAppForLogin(deviceId: string, body: IVerifyMFAAuthenticatorApp): Promise<ILoginResponse>;
|
|
163
|
+
/**
|
|
164
|
+
* pre enroll Multi-Factor to use with SMS
|
|
165
|
+
* the server returns otcToken that should be sent to the enroll function with the code that was sent to
|
|
166
|
+
* the request phone number
|
|
167
|
+
*/
|
|
168
|
+
export declare function preEnrollMFASMSForLogin(body: IPreEnrollMFASMS): Promise<void>;
|
|
169
|
+
/**
|
|
170
|
+
* after pre enroll with SMS, enroll SMS function should be called
|
|
171
|
+
* with the otcToken and the code that has been sent to the phone number that was requested
|
|
172
|
+
*/
|
|
173
|
+
export declare function enrollMFASMSForLogin(body: IEnrollMFASMS): Promise<ILoginResponse>;
|
|
174
|
+
/**
|
|
175
|
+
* after login succeeded with mfaRequired token response, if the user asked to use SMS as MFA
|
|
176
|
+
* this function should be called with the selected device id and mfaToken
|
|
177
|
+
*/
|
|
178
|
+
export declare function preVerifyMFASMSForLogin(deviceId: string, body: IPreVerifyMFA): Promise<IPreVerifyMFASMSResponse>;
|
|
179
|
+
/**
|
|
180
|
+
* after pre verify with SMS, this function should be called with otcToken, mfaToken and the code
|
|
181
|
+
* that has been sent to the selected device.
|
|
182
|
+
*/
|
|
183
|
+
export declare function verifyMFASMSForLogin(deviceId: string, body: IVerifyMFASMS): Promise<ILoginResponse>;
|
|
184
|
+
/**
|
|
185
|
+
* pre enroll Multi-Factor to use with WebAuthn
|
|
186
|
+
* the server returns attestation object
|
|
187
|
+
* the request phone number
|
|
188
|
+
*/
|
|
189
|
+
export declare function preEnrollMFAWebAuthnForLogin(body: IPreEnrollMFA): Promise<IPreEnrollMFAWebAuthnResponse>;
|
|
190
|
+
/**
|
|
191
|
+
* after pre enroll with WebAuthn, enroll WebAuthn function should be called
|
|
192
|
+
* with the webauthnToken and the attestation object response
|
|
193
|
+
*/
|
|
194
|
+
export declare function enrollMFAWebAuthnForLogin(body: IEnrollMFAWebAuthn): Promise<ILoginResponse>;
|
|
195
|
+
/**
|
|
196
|
+
* after login succeeded with mfaRequired token response, if the user asked to use WebAuthn as MFA
|
|
197
|
+
* this function should be called with the selected device id and mfaToken.
|
|
198
|
+
*/
|
|
199
|
+
export declare function preVerifyMFAWebAuthnForLogin(deviceId: string, body: IPreVerifyMFA): Promise<IPreVerifyMFAWebAuthnResponse>;
|
|
200
|
+
/**
|
|
201
|
+
* after pre verify with WebAuthn, this function should be called with webauthnTokenToken, mfaToken
|
|
202
|
+
* and the assertion response.
|
|
203
|
+
*/
|
|
204
|
+
export declare function verifyMFAWebAuthnForLogin(deviceId: string, body: IVerifyMFAWebAuthn): Promise<ILoginResponse>;
|
|
148
205
|
/**
|
|
149
206
|
* SSO Configurations
|
|
150
207
|
*/
|
package/auth/index.js
CHANGED
|
@@ -134,6 +134,39 @@ export async function verifyMfa(body) {
|
|
|
134
134
|
export async function disableMfa(body) {
|
|
135
135
|
return Post(`${urls.identity.users.v1}/mfa/disable`, body);
|
|
136
136
|
}
|
|
137
|
+
export async function preEnrollMFAAuthenticatorAppForLogin(body) {
|
|
138
|
+
return Post(`${urls.identity.auth.v1}/user/mfa/authenticator/enroll`, body);
|
|
139
|
+
}
|
|
140
|
+
export async function enrollMFAAuthenticatorAppForLogin(body) {
|
|
141
|
+
return Post(`${urls.identity.auth.v1}/user/mfa/authenticator/enroll/verify`, body);
|
|
142
|
+
}
|
|
143
|
+
export async function verifyMFAAuthenticatorAppForLogin(deviceId, body) {
|
|
144
|
+
return Post(`${urls.identity.auth.v1}/user/mfa/authenticator/${deviceId}/verify`, body);
|
|
145
|
+
}
|
|
146
|
+
export async function preEnrollMFASMSForLogin(body) {
|
|
147
|
+
return Post(`${urls.identity.auth.v1}/user/mfa/sms/enroll`, body);
|
|
148
|
+
}
|
|
149
|
+
export async function enrollMFASMSForLogin(body) {
|
|
150
|
+
return Post(`${urls.identity.auth.v1}/user/mfa/sms/enroll/verify`, body);
|
|
151
|
+
}
|
|
152
|
+
export async function preVerifyMFASMSForLogin(deviceId, body) {
|
|
153
|
+
return Post(`${urls.identity.auth.v1}/user/mfa/sms/${deviceId}`, body);
|
|
154
|
+
}
|
|
155
|
+
export async function verifyMFASMSForLogin(deviceId, body) {
|
|
156
|
+
return Post(`${urls.identity.auth.v1}/user/mfa/sms/${deviceId}/verify`, body);
|
|
157
|
+
}
|
|
158
|
+
export async function preEnrollMFAWebAuthnForLogin(body) {
|
|
159
|
+
return Post(`${urls.identity.auth.v1}/user/mfa/webauthn/enroll`, body);
|
|
160
|
+
}
|
|
161
|
+
export async function enrollMFAWebAuthnForLogin(body) {
|
|
162
|
+
return Post(`${urls.identity.auth.v1}/user/mfa/webauthn/enroll/verify`, body);
|
|
163
|
+
}
|
|
164
|
+
export async function preVerifyMFAWebAuthnForLogin(deviceId, body) {
|
|
165
|
+
return Post(`${urls.identity.auth.v1}/user/mfa/webauthn/${deviceId}`, body);
|
|
166
|
+
}
|
|
167
|
+
export async function verifyMFAWebAuthnForLogin(deviceId, body) {
|
|
168
|
+
return Post(`${urls.identity.auth.v1}/user/mfa/webauthn/${deviceId}/verify`, body);
|
|
169
|
+
}
|
|
137
170
|
export async function getSamlConfiguration() {
|
|
138
171
|
return Get(`${urls.team.sso.v1}/saml/configurations`);
|
|
139
172
|
}
|
package/auth/interfaces.d.ts
CHANGED
|
@@ -41,6 +41,8 @@ export declare type ILoginResponse = IUserProfile & {
|
|
|
41
41
|
emailVerified?: boolean;
|
|
42
42
|
redirectLocation?: string;
|
|
43
43
|
userEmail?: string;
|
|
44
|
+
mfaStrategies?: MFAStrategyEnum[];
|
|
45
|
+
mfaDevices?: UserMFADevicesResponse[];
|
|
44
46
|
};
|
|
45
47
|
export declare type ILoginResponseV2 = {
|
|
46
48
|
user: ILoginResponse;
|
|
@@ -445,3 +447,89 @@ export interface IAuthStrategyConfig {
|
|
|
445
447
|
export interface IAuthStrategiesConfig {
|
|
446
448
|
secondaryAuthStrategies: IAuthStrategyConfig[];
|
|
447
449
|
}
|
|
450
|
+
export interface IPreEnrollMFA {
|
|
451
|
+
mfaToken: string;
|
|
452
|
+
}
|
|
453
|
+
export interface IEnrollMFA {
|
|
454
|
+
mfaToken: string;
|
|
455
|
+
rememberDevice?: boolean;
|
|
456
|
+
}
|
|
457
|
+
export interface IPreEnrollMFAAuthenticatorAppResponse {
|
|
458
|
+
qrCode: string;
|
|
459
|
+
}
|
|
460
|
+
export interface IEnrollMFAAuthenticatorApp extends IEnrollMFA {
|
|
461
|
+
token: string;
|
|
462
|
+
}
|
|
463
|
+
export interface IPreEnrollMFASMS extends IPreEnrollMFA {
|
|
464
|
+
phoneNumber: string;
|
|
465
|
+
}
|
|
466
|
+
export interface IPreEnrollMFASMSResponse {
|
|
467
|
+
otcToken: string;
|
|
468
|
+
phoneNumber: string;
|
|
469
|
+
}
|
|
470
|
+
export interface IEnrollMFASMS extends IEnrollMFA {
|
|
471
|
+
otcToken: string;
|
|
472
|
+
code: string;
|
|
473
|
+
}
|
|
474
|
+
export declare enum WebAuthnDeviceType {
|
|
475
|
+
Android = "Android",
|
|
476
|
+
USBKey = "USBKey",
|
|
477
|
+
TouchID = "TouchID"
|
|
478
|
+
}
|
|
479
|
+
export interface IEnrollMFAWebAuthn extends IEnrollMFA {
|
|
480
|
+
deviceType: WebAuthnDeviceType;
|
|
481
|
+
webauthnToken: string;
|
|
482
|
+
options: IVerifyNewWebAuthnDevice;
|
|
483
|
+
}
|
|
484
|
+
export interface IPreEnrollMFAWebAuthnResponse {
|
|
485
|
+
webauthnToken: string;
|
|
486
|
+
options: ICreateNewDeviceSessionResponse;
|
|
487
|
+
}
|
|
488
|
+
export interface IPreVerifyMFA {
|
|
489
|
+
mfaToken: string;
|
|
490
|
+
}
|
|
491
|
+
export interface IVerifyMFA {
|
|
492
|
+
mfaToken: string;
|
|
493
|
+
rememberDevice?: boolean;
|
|
494
|
+
}
|
|
495
|
+
export interface IVerifyMFAAuthenticatorApp extends IVerifyMFA {
|
|
496
|
+
value: string;
|
|
497
|
+
}
|
|
498
|
+
export interface IPreVerifyMFASMSResponse {
|
|
499
|
+
otcToken: string;
|
|
500
|
+
phoneNumber: string;
|
|
501
|
+
}
|
|
502
|
+
export interface IVerifyMFASMS extends IVerifyMFA {
|
|
503
|
+
otcToken: string;
|
|
504
|
+
code: string;
|
|
505
|
+
}
|
|
506
|
+
export interface IPreVerifyMFAWebAuthnResponse {
|
|
507
|
+
webauthnToken: string;
|
|
508
|
+
options: IWebAuthnPreLoginResponse;
|
|
509
|
+
}
|
|
510
|
+
export interface IVerifyMFAWebAuthn extends IVerifyMFA {
|
|
511
|
+
webauthnToken: string;
|
|
512
|
+
options: Omit<IWebAuthnPostLogin, "recaptchaToken" | "invitationToken">;
|
|
513
|
+
}
|
|
514
|
+
export declare enum MFAStrategyEnum {
|
|
515
|
+
AuthenticatorApp = "AuthenticatorApp",
|
|
516
|
+
WebAuthn = "WebAuthn",
|
|
517
|
+
SMS = "SMS"
|
|
518
|
+
}
|
|
519
|
+
export interface UserMFAWebAuthnDevice {
|
|
520
|
+
id: string;
|
|
521
|
+
deviceType: WebAuthnDeviceType;
|
|
522
|
+
name: string;
|
|
523
|
+
}
|
|
524
|
+
export interface UserMFAPhoneDevice {
|
|
525
|
+
id: string;
|
|
526
|
+
phoneNumber: string;
|
|
527
|
+
}
|
|
528
|
+
export interface UserMFAAuthenticatorApp {
|
|
529
|
+
id: string;
|
|
530
|
+
}
|
|
531
|
+
export interface UserMFADevicesResponse {
|
|
532
|
+
webauthn: UserMFAWebAuthnDevice[];
|
|
533
|
+
phones: UserMFAPhoneDevice[];
|
|
534
|
+
authenticators: UserMFAAuthenticatorApp[];
|
|
535
|
+
}
|
package/auth/interfaces.js
CHANGED
|
@@ -13,4 +13,20 @@ export let SecondaryAuthStrategy;
|
|
|
13
13
|
SecondaryAuthStrategy["WebAuthnPlatform"] = "WebAuthnPlatform";
|
|
14
14
|
SecondaryAuthStrategy["WebAuthnCrossPlatform"] = "WebAuthnCrossPlatform";
|
|
15
15
|
SecondaryAuthStrategy["SmsCode"] = "SmsCode";
|
|
16
|
-
})(SecondaryAuthStrategy || (SecondaryAuthStrategy = {}));
|
|
16
|
+
})(SecondaryAuthStrategy || (SecondaryAuthStrategy = {}));
|
|
17
|
+
|
|
18
|
+
export let WebAuthnDeviceType;
|
|
19
|
+
|
|
20
|
+
(function (WebAuthnDeviceType) {
|
|
21
|
+
WebAuthnDeviceType["Android"] = "Android";
|
|
22
|
+
WebAuthnDeviceType["USBKey"] = "USBKey";
|
|
23
|
+
WebAuthnDeviceType["TouchID"] = "TouchID";
|
|
24
|
+
})(WebAuthnDeviceType || (WebAuthnDeviceType = {}));
|
|
25
|
+
|
|
26
|
+
export let MFAStrategyEnum;
|
|
27
|
+
|
|
28
|
+
(function (MFAStrategyEnum) {
|
|
29
|
+
MFAStrategyEnum["AuthenticatorApp"] = "AuthenticatorApp";
|
|
30
|
+
MFAStrategyEnum["WebAuthn"] = "WebAuthn";
|
|
31
|
+
MFAStrategyEnum["SMS"] = "SMS";
|
|
32
|
+
})(MFAStrategyEnum || (MFAStrategyEnum = {}));
|
package/index.js
CHANGED
package/node/auth/index.js
CHANGED
|
@@ -30,6 +30,17 @@ var _exportNames = {
|
|
|
30
30
|
enrollMfa: true,
|
|
31
31
|
verifyMfa: true,
|
|
32
32
|
disableMfa: true,
|
|
33
|
+
preEnrollMFAAuthenticatorAppForLogin: true,
|
|
34
|
+
enrollMFAAuthenticatorAppForLogin: true,
|
|
35
|
+
verifyMFAAuthenticatorAppForLogin: true,
|
|
36
|
+
preEnrollMFASMSForLogin: true,
|
|
37
|
+
enrollMFASMSForLogin: true,
|
|
38
|
+
preVerifyMFASMSForLogin: true,
|
|
39
|
+
verifyMFASMSForLogin: true,
|
|
40
|
+
preEnrollMFAWebAuthnForLogin: true,
|
|
41
|
+
enrollMFAWebAuthnForLogin: true,
|
|
42
|
+
preVerifyMFAWebAuthnForLogin: true,
|
|
43
|
+
verifyMFAWebAuthnForLogin: true,
|
|
33
44
|
getSamlConfiguration: true,
|
|
34
45
|
updateSamlConfiguration: true,
|
|
35
46
|
getSamlVendorConfiguration: true,
|
|
@@ -116,6 +127,9 @@ exports.deleteSessionForUser = deleteSessionForUser;
|
|
|
116
127
|
exports.deleteTenantApiToken = deleteTenantApiToken;
|
|
117
128
|
exports.deleteUserApiToken = deleteUserApiToken;
|
|
118
129
|
exports.disableMfa = disableMfa;
|
|
130
|
+
exports.enrollMFAAuthenticatorAppForLogin = enrollMFAAuthenticatorAppForLogin;
|
|
131
|
+
exports.enrollMFASMSForLogin = enrollMFASMSForLogin;
|
|
132
|
+
exports.enrollMFAWebAuthnForLogin = enrollMFAWebAuthnForLogin;
|
|
119
133
|
exports.enrollMfa = enrollMfa;
|
|
120
134
|
exports.exchangeOAuthTokens = exchangeOAuthTokens;
|
|
121
135
|
exports.forgotPassword = forgotPassword;
|
|
@@ -152,9 +166,14 @@ exports.oidcPostLoginV2 = oidcPostLoginV2;
|
|
|
152
166
|
exports.passwordlessPostLogin = passwordlessPostLogin;
|
|
153
167
|
exports.passwordlessPreLogin = passwordlessPreLogin;
|
|
154
168
|
exports.postLogin = postLogin;
|
|
169
|
+
exports.preEnrollMFAAuthenticatorAppForLogin = preEnrollMFAAuthenticatorAppForLogin;
|
|
170
|
+
exports.preEnrollMFASMSForLogin = preEnrollMFASMSForLogin;
|
|
171
|
+
exports.preEnrollMFAWebAuthnForLogin = preEnrollMFAWebAuthnForLogin;
|
|
155
172
|
exports.preLogin = preLogin;
|
|
156
173
|
exports.preLoginV2 = preLoginV2;
|
|
157
174
|
exports.preLoginWithIdpType = preLoginWithIdpType;
|
|
175
|
+
exports.preVerifyMFASMSForLogin = preVerifyMFASMSForLogin;
|
|
176
|
+
exports.preVerifyMFAWebAuthnForLogin = preVerifyMFAWebAuthnForLogin;
|
|
158
177
|
exports.recoverMfaToken = recoverMfaToken;
|
|
159
178
|
exports.refreshToken = refreshToken;
|
|
160
179
|
exports.refreshTokenV2 = refreshTokenV2;
|
|
@@ -179,6 +198,9 @@ exports.validateSSODomain = validateSSODomain;
|
|
|
179
198
|
exports.validateSamlDomain = validateSamlDomain;
|
|
180
199
|
exports.verifyChangePhoneNumber = verifyChangePhoneNumber;
|
|
181
200
|
exports.verifyInviteToken = verifyInviteToken;
|
|
201
|
+
exports.verifyMFAAuthenticatorAppForLogin = verifyMFAAuthenticatorAppForLogin;
|
|
202
|
+
exports.verifyMFASMSForLogin = verifyMFASMSForLogin;
|
|
203
|
+
exports.verifyMFAWebAuthnForLogin = verifyMFAWebAuthnForLogin;
|
|
182
204
|
exports.verifyMfa = verifyMfa;
|
|
183
205
|
exports.verifyNewDeviceSession = verifyNewDeviceSession;
|
|
184
206
|
exports.verifyResetPhoneNumber = verifyResetPhoneNumber;
|
|
@@ -383,6 +405,50 @@ async function disableMfa(body) {
|
|
|
383
405
|
return (0, _fetch.Post)(`${_constants.urls.identity.users.v1}/mfa/disable`, body);
|
|
384
406
|
}
|
|
385
407
|
|
|
408
|
+
async function preEnrollMFAAuthenticatorAppForLogin(body) {
|
|
409
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/authenticator/enroll`, body);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
async function enrollMFAAuthenticatorAppForLogin(body) {
|
|
413
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/authenticator/enroll/verify`, body);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
async function verifyMFAAuthenticatorAppForLogin(deviceId, body) {
|
|
417
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/authenticator/${deviceId}/verify`, body);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
async function preEnrollMFASMSForLogin(body) {
|
|
421
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/sms/enroll`, body);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
async function enrollMFASMSForLogin(body) {
|
|
425
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/sms/enroll/verify`, body);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
async function preVerifyMFASMSForLogin(deviceId, body) {
|
|
429
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/sms/${deviceId}`, body);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
async function verifyMFASMSForLogin(deviceId, body) {
|
|
433
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/sms/${deviceId}/verify`, body);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
async function preEnrollMFAWebAuthnForLogin(body) {
|
|
437
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/webauthn/enroll`, body);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
async function enrollMFAWebAuthnForLogin(body) {
|
|
441
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/webauthn/enroll/verify`, body);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
async function preVerifyMFAWebAuthnForLogin(deviceId, body) {
|
|
445
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/webauthn/${deviceId}`, body);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
async function verifyMFAWebAuthnForLogin(deviceId, body) {
|
|
449
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.auth.v1}/user/mfa/webauthn/${deviceId}/verify`, body);
|
|
450
|
+
}
|
|
451
|
+
|
|
386
452
|
async function getSamlConfiguration() {
|
|
387
453
|
return (0, _fetch.Get)(`${_constants.urls.team.sso.v1}/saml/configurations`);
|
|
388
454
|
}
|
package/node/auth/interfaces.js
CHANGED
|
@@ -4,9 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
-
SecondaryAuthStrategy: true
|
|
7
|
+
SecondaryAuthStrategy: true,
|
|
8
|
+
WebAuthnDeviceType: true,
|
|
9
|
+
MFAStrategyEnum: true
|
|
8
10
|
};
|
|
9
|
-
exports.SecondaryAuthStrategy = void 0;
|
|
11
|
+
exports.WebAuthnDeviceType = exports.SecondaryAuthStrategy = exports.MFAStrategyEnum = void 0;
|
|
10
12
|
|
|
11
13
|
var _interfaces = require("./secutiry-poilicy/interfaces");
|
|
12
14
|
|
|
@@ -36,4 +38,22 @@ exports.SecondaryAuthStrategy = SecondaryAuthStrategy;
|
|
|
36
38
|
SecondaryAuthStrategy["WebAuthnPlatform"] = "WebAuthnPlatform";
|
|
37
39
|
SecondaryAuthStrategy["WebAuthnCrossPlatform"] = "WebAuthnCrossPlatform";
|
|
38
40
|
SecondaryAuthStrategy["SmsCode"] = "SmsCode";
|
|
39
|
-
})(SecondaryAuthStrategy || (exports.SecondaryAuthStrategy = SecondaryAuthStrategy = {}));
|
|
41
|
+
})(SecondaryAuthStrategy || (exports.SecondaryAuthStrategy = SecondaryAuthStrategy = {}));
|
|
42
|
+
|
|
43
|
+
let WebAuthnDeviceType;
|
|
44
|
+
exports.WebAuthnDeviceType = WebAuthnDeviceType;
|
|
45
|
+
|
|
46
|
+
(function (WebAuthnDeviceType) {
|
|
47
|
+
WebAuthnDeviceType["Android"] = "Android";
|
|
48
|
+
WebAuthnDeviceType["USBKey"] = "USBKey";
|
|
49
|
+
WebAuthnDeviceType["TouchID"] = "TouchID";
|
|
50
|
+
})(WebAuthnDeviceType || (exports.WebAuthnDeviceType = WebAuthnDeviceType = {}));
|
|
51
|
+
|
|
52
|
+
let MFAStrategyEnum;
|
|
53
|
+
exports.MFAStrategyEnum = MFAStrategyEnum;
|
|
54
|
+
|
|
55
|
+
(function (MFAStrategyEnum) {
|
|
56
|
+
MFAStrategyEnum["AuthenticatorApp"] = "AuthenticatorApp";
|
|
57
|
+
MFAStrategyEnum["WebAuthn"] = "WebAuthn";
|
|
58
|
+
MFAStrategyEnum["SMS"] = "SMS";
|
|
59
|
+
})(MFAStrategyEnum || (exports.MFAStrategyEnum = MFAStrategyEnum = {}));
|
package/node/index.js
CHANGED