@frontegg/rest-api 3.0.40 → 3.0.41
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 +38 -1
- package/auth/index.js +21 -1
- package/auth/interfaces.d.ts +11 -0
- package/index.js +1 -1
- package/node/auth/index.js +42 -2
- 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, IPreEnrollMFA, IEnrollMFAAuthenticatorApp, IPreEnrollMFASMS, IEnrollMFASMS, IEnrollMFAWebAuthn, IPreEnrollMFAAuthenticatorAppResponse, IPreEnrollMFAWebAuthnResponse, IVerifyMFAAuthenticatorApp, IPreVerifyMFA, IPreVerifyMFASMSResponse, IVerifyMFASMS, IPreVerifyMFAWebAuthnResponse, IVerifyMFAWebAuthn, IPreEnrollMFASMSResponse, IPreDisableMFASMSResponse, IDisableMFASMS, IDisableMFAWebAuthn, IPreDisableMFAWebAuthnResponse, UserMFADevicesResponse } from
|
|
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, IPreEnrollMFASMSResponse, IPreDisableMFASMSResponse, IDisableMFASMS, IDisableMFAWebAuthn, IPreDisableMFAWebAuthnResponse, UserMFADevicesResponse, WithoutMFAToken, IMFAStrategiesResponse } from "./interfaces";
|
|
5
5
|
/*****************************************
|
|
6
6
|
* Authentication
|
|
7
7
|
*****************************************/
|
|
@@ -129,6 +129,39 @@ export declare function recoverMfaToken(body: IRecoverMFAToken): Promise<void>;
|
|
|
129
129
|
* ``authorized user``
|
|
130
130
|
*/
|
|
131
131
|
export declare function enrollMfa(): Promise<IEnrollMfaResponse>;
|
|
132
|
+
/**
|
|
133
|
+
* pre enroll Multi-Factor Auth Code to use in 3rd party apps like Google Authenticator.
|
|
134
|
+
* the server returns qrCode as png image in base64 format
|
|
135
|
+
*
|
|
136
|
+
* @throws exception if the user already have mfa-enabled
|
|
137
|
+
* ``authorized user``
|
|
138
|
+
*/
|
|
139
|
+
export declare function preEnrollMFAAuthenticatorApp(): Promise<IPreEnrollMFAAuthenticatorAppResponse>;
|
|
140
|
+
/**
|
|
141
|
+
* enroll Multi-Factor Auth Code to use in 3rd party apps like Google Authenticator.
|
|
142
|
+
*/
|
|
143
|
+
export declare function enrollMFAAuthenticatorApp(body: WithoutMFAToken<IEnrollMFAAuthenticatorApp>): Promise<void>;
|
|
144
|
+
/**
|
|
145
|
+
* pre enroll Multi-Factor SMS
|
|
146
|
+
* the server returns otcToken that should be sent to the enroll function with the code that was sent to
|
|
147
|
+
*/
|
|
148
|
+
export declare function preEnrollMFASMS(): Promise<IPreEnrollMFASMSResponse>;
|
|
149
|
+
/**
|
|
150
|
+
* after pre enroll with SMS, enroll SMS function should be called
|
|
151
|
+
* with the otcToken and the code that has been sent to the phone number that was requested
|
|
152
|
+
*/
|
|
153
|
+
export declare function enrollMFASMS(body: WithoutMFAToken<IEnrollMFASMS>): Promise<void>;
|
|
154
|
+
/**
|
|
155
|
+
* pre enroll Multi-Factor to use with WebAuthn
|
|
156
|
+
* the server returns attestation object
|
|
157
|
+
* the request phone number
|
|
158
|
+
*/
|
|
159
|
+
export declare function preEnrollMFAWebAuthn(): Promise<IPreEnrollMFAWebAuthnResponse>;
|
|
160
|
+
/**
|
|
161
|
+
* after pre enroll with WebAuthn, enroll WebAuthn function should be called
|
|
162
|
+
* with the webauthnToken and the attestation object response
|
|
163
|
+
*/
|
|
164
|
+
export declare function enrollMFAWebAuthn(body: WithoutMFAToken<IEnrollMFAWebAuthn>): Promise<void>;
|
|
132
165
|
/**
|
|
133
166
|
* after enrolling MFA QR code, verify function should be called
|
|
134
167
|
* with the generated code in the Authenticator App
|
|
@@ -559,3 +592,7 @@ export declare function verifyNewDeviceSession(body: IVerifyNewWebAuthnDevice):
|
|
|
559
592
|
* Get public vendor auth strategies public configuration
|
|
560
593
|
*/
|
|
561
594
|
export declare function getVendorPublicAuthStrategiesConfig(): Promise<IAuthStrategiesConfig>;
|
|
595
|
+
/**
|
|
596
|
+
* Get vendor mfa strategies configuration
|
|
597
|
+
*/
|
|
598
|
+
export declare function getMFAStrategiesConfig(): Promise<IMFAStrategiesResponse>;
|
package/auth/index.js
CHANGED
|
@@ -128,6 +128,24 @@ export async function recoverMfaToken(body) {
|
|
|
128
128
|
export async function enrollMfa() {
|
|
129
129
|
return Post(`${urls.identity.users.v1}/mfa/enroll`);
|
|
130
130
|
}
|
|
131
|
+
export async function preEnrollMFAAuthenticatorApp() {
|
|
132
|
+
return Post(`${urls.identity.users.v1}/mfa/authenticator/enroll`);
|
|
133
|
+
}
|
|
134
|
+
export async function enrollMFAAuthenticatorApp(body) {
|
|
135
|
+
return Post(`${urls.identity.users.v1}/mfa/authenticator/enroll/verify`, body);
|
|
136
|
+
}
|
|
137
|
+
export async function preEnrollMFASMS() {
|
|
138
|
+
return Post(`${urls.identity.users.v1}/mfa/sms/enroll`);
|
|
139
|
+
}
|
|
140
|
+
export async function enrollMFASMS(body) {
|
|
141
|
+
return Post(`${urls.identity.users.v1}/mfa/sms/enroll/verify`, body);
|
|
142
|
+
}
|
|
143
|
+
export async function preEnrollMFAWebAuthn() {
|
|
144
|
+
return Post(`${urls.identity.users.v1}/mfa/webauthn/enroll`);
|
|
145
|
+
}
|
|
146
|
+
export async function enrollMFAWebAuthn(body) {
|
|
147
|
+
return Post(`${urls.identity.users.v1}/mfa/webauthn/enroll/verify`, body);
|
|
148
|
+
}
|
|
131
149
|
export async function verifyMfa(body) {
|
|
132
150
|
return Post(`${urls.identity.users.v1}/mfa/enroll/verify`, body);
|
|
133
151
|
}
|
|
@@ -474,4 +492,6 @@ export async function verifyNewDeviceSession(body) {
|
|
|
474
492
|
export async function getVendorPublicAuthStrategiesConfig() {
|
|
475
493
|
return Get(`${urls.identity.configurations.v1}/auth/strategies/public`);
|
|
476
494
|
}
|
|
477
|
-
|
|
495
|
+
export async function getMFAStrategiesConfig() {
|
|
496
|
+
return Get(`${urls.identity.configurations.v1}/mfa/strategies`);
|
|
497
|
+
}
|
package/auth/interfaces.d.ts
CHANGED
|
@@ -549,3 +549,14 @@ export interface IDisableMFAWebAuthn {
|
|
|
549
549
|
webauthnToken?: string;
|
|
550
550
|
options?: Omit<IWebAuthnPostLogin, "recaptchaToken" | "invitationToken">;
|
|
551
551
|
}
|
|
552
|
+
export interface IPreEnrollMFAAuthenticatorApp {
|
|
553
|
+
qrCode: string;
|
|
554
|
+
}
|
|
555
|
+
export declare type WithoutMFAToken<T> = Omit<T | 'mfaToken', 'rememberDevice'>;
|
|
556
|
+
export interface IMFAStrategyResponse {
|
|
557
|
+
strategy: MFAStrategyEnum;
|
|
558
|
+
isActive: boolean;
|
|
559
|
+
}
|
|
560
|
+
export interface IMFAStrategiesResponse {
|
|
561
|
+
strategies: IMFAStrategyResponse[];
|
|
562
|
+
}
|
package/index.js
CHANGED
package/node/auth/index.js
CHANGED
|
@@ -28,6 +28,12 @@ var _exportNames = {
|
|
|
28
28
|
loadPasswordConfig: true,
|
|
29
29
|
recoverMfaToken: true,
|
|
30
30
|
enrollMfa: true,
|
|
31
|
+
preEnrollMFAAuthenticatorApp: true,
|
|
32
|
+
enrollMFAAuthenticatorApp: true,
|
|
33
|
+
preEnrollMFASMS: true,
|
|
34
|
+
enrollMFASMS: true,
|
|
35
|
+
preEnrollMFAWebAuthn: true,
|
|
36
|
+
enrollMFAWebAuthn: true,
|
|
31
37
|
verifyMfa: true,
|
|
32
38
|
disableMfa: true,
|
|
33
39
|
disableMFAAuthenticatorApp: true,
|
|
@@ -111,7 +117,8 @@ var _exportNames = {
|
|
|
111
117
|
webAuthnPostLogin: true,
|
|
112
118
|
webAuthnCreateNewDeviceSession: true,
|
|
113
119
|
verifyNewDeviceSession: true,
|
|
114
|
-
getVendorPublicAuthStrategiesConfig: true
|
|
120
|
+
getVendorPublicAuthStrategiesConfig: true,
|
|
121
|
+
getMFAStrategiesConfig: true
|
|
115
122
|
};
|
|
116
123
|
exports.acceptInvitation = acceptInvitation;
|
|
117
124
|
exports.activateAccount = activateAccount;
|
|
@@ -136,8 +143,11 @@ exports.disableMFAAuthenticatorApp = disableMFAAuthenticatorApp;
|
|
|
136
143
|
exports.disableMFASMS = disableMFASMS;
|
|
137
144
|
exports.disableMFAWebAuthn = disableMFAWebAuthn;
|
|
138
145
|
exports.disableMfa = disableMfa;
|
|
146
|
+
exports.enrollMFAAuthenticatorApp = enrollMFAAuthenticatorApp;
|
|
139
147
|
exports.enrollMFAAuthenticatorAppForLogin = enrollMFAAuthenticatorAppForLogin;
|
|
148
|
+
exports.enrollMFASMS = enrollMFASMS;
|
|
140
149
|
exports.enrollMFASMSForLogin = enrollMFASMSForLogin;
|
|
150
|
+
exports.enrollMFAWebAuthn = enrollMFAWebAuthn;
|
|
141
151
|
exports.enrollMFAWebAuthnForLogin = enrollMFAWebAuthnForLogin;
|
|
142
152
|
exports.enrollMfa = enrollMfa;
|
|
143
153
|
exports.exchangeOAuthTokens = exchangeOAuthTokens;
|
|
@@ -149,6 +159,7 @@ exports.getActivateAccountStrategy = getActivateAccountStrategy;
|
|
|
149
159
|
exports.getCurrentUserSession = getCurrentUserSession;
|
|
150
160
|
exports.getCurrentUserSessions = getCurrentUserSessions;
|
|
151
161
|
exports.getMFADevices = getMFADevices;
|
|
162
|
+
exports.getMFAStrategiesConfig = getMFAStrategiesConfig;
|
|
152
163
|
exports.getOidcConfiguration = getOidcConfiguration;
|
|
153
164
|
exports.getSSOConfigurations = getSSOConfigurations;
|
|
154
165
|
exports.getSSODefaultRoles = getSSODefaultRoles;
|
|
@@ -178,8 +189,11 @@ exports.passwordlessPreLogin = passwordlessPreLogin;
|
|
|
178
189
|
exports.postLogin = postLogin;
|
|
179
190
|
exports.preDisableMFASMS = preDisableMFASMS;
|
|
180
191
|
exports.preDisableMFAWebAuthn = preDisableMFAWebAuthn;
|
|
192
|
+
exports.preEnrollMFAAuthenticatorApp = preEnrollMFAAuthenticatorApp;
|
|
181
193
|
exports.preEnrollMFAAuthenticatorAppForLogin = preEnrollMFAAuthenticatorAppForLogin;
|
|
194
|
+
exports.preEnrollMFASMS = preEnrollMFASMS;
|
|
182
195
|
exports.preEnrollMFASMSForLogin = preEnrollMFASMSForLogin;
|
|
196
|
+
exports.preEnrollMFAWebAuthn = preEnrollMFAWebAuthn;
|
|
183
197
|
exports.preEnrollMFAWebAuthnForLogin = preEnrollMFAWebAuthnForLogin;
|
|
184
198
|
exports.preLogin = preLogin;
|
|
185
199
|
exports.preLoginV2 = preLoginV2;
|
|
@@ -409,6 +423,30 @@ async function enrollMfa() {
|
|
|
409
423
|
return (0, _fetch.Post)(`${_constants.urls.identity.users.v1}/mfa/enroll`);
|
|
410
424
|
}
|
|
411
425
|
|
|
426
|
+
async function preEnrollMFAAuthenticatorApp() {
|
|
427
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.users.v1}/mfa/authenticator/enroll`);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
async function enrollMFAAuthenticatorApp(body) {
|
|
431
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.users.v1}/mfa/authenticator/enroll/verify`, body);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
async function preEnrollMFASMS() {
|
|
435
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.users.v1}/mfa/sms/enroll`);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
async function enrollMFASMS(body) {
|
|
439
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.users.v1}/mfa/sms/enroll/verify`, body);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
async function preEnrollMFAWebAuthn() {
|
|
443
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.users.v1}/mfa/webauthn/enroll`);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
async function enrollMFAWebAuthn(body) {
|
|
447
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.users.v1}/mfa/webauthn/enroll/verify`, body);
|
|
448
|
+
}
|
|
449
|
+
|
|
412
450
|
async function verifyMfa(body) {
|
|
413
451
|
return (0, _fetch.Post)(`${_constants.urls.identity.users.v1}/mfa/enroll/verify`, body);
|
|
414
452
|
}
|
|
@@ -837,4 +875,6 @@ async function getVendorPublicAuthStrategiesConfig() {
|
|
|
837
875
|
return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/auth/strategies/public`);
|
|
838
876
|
}
|
|
839
877
|
|
|
840
|
-
|
|
878
|
+
async function getMFAStrategiesConfig() {
|
|
879
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.configurations.v1}/mfa/strategies`);
|
|
880
|
+
}
|
package/node/index.js
CHANGED