@authing/guard-shim-react 4.5.50-alpha.10 → 4.5.50-alpha.14
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/dist/guard.min.css +1021 -1
- package/dist/guard.min.js +49550 -24635
- package/dist/typings/src/Guard/module.d.ts +1 -2
- package/dist/typings/src/Login/core/withMFA/MFAFormItemIdentify.d.ts +17 -0
- package/dist/typings/src/Login/core/withMFA/MFAInputIdentify.d.ts +7 -0
- package/dist/typings/src/Login/core/withMFA/index.d.ts +2 -0
- package/dist/typings/src/Login/interface.d.ts +2 -0
- package/dist/typings/src/MFA/businessRequest.d.ts +33 -2
- package/dist/typings/src/MFA/core/AwsFaceLivenessDetector.d.ts +18 -0
- package/dist/typings/src/MFA/core/passkey.d.ts +0 -1
- package/dist/typings/src/Register/core/WithEmailCode.d.ts +0 -3
- package/dist/typings/src/Register/core/WithPhone.d.ts +0 -3
- package/dist/typings/src/SendCode/SendCodeByEmail.d.ts +0 -3
- package/dist/typings/src/SendCode/SendCodeByPhone.d.ts +0 -1
- package/dist/typings/src/Type/application.d.ts +8 -21
- package/dist/typings/src/Type/index.d.ts +4 -0
- package/dist/typings/src/_utils/config/index.d.ts +3 -1
- package/dist/typings/src/_utils/context.d.ts +2 -4
- package/package.json +1 -1
- package/dist/typings/src/Register/components/AccountType/index.d.ts +0 -3
|
@@ -33,8 +33,7 @@ export declare enum GuardModuleType {
|
|
|
33
33
|
INVITE_EXPIRE = "inviteExpire",// 邀请链接过期
|
|
34
34
|
INVITE_PAGE_EXPIRE = "invitePageExpire",// 页面过期
|
|
35
35
|
INVITE_SUCCESS = "inviteSuccess",// 邀请成功
|
|
36
|
-
RESET_PASSWORD = "resetPassword"
|
|
37
|
-
REGISTER_ACCOUNT_TYPE_SELECT = "accountTypeSelect"
|
|
36
|
+
RESET_PASSWORD = "resetPassword"
|
|
38
37
|
}
|
|
39
38
|
export interface GuardModuleAction {
|
|
40
39
|
action: string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MFAInputMethod } from '../../../Type';
|
|
2
|
+
import { ReactNode } from 'shim-react';
|
|
3
|
+
interface MFAFormItemIdentifyProps {
|
|
4
|
+
name: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
form: any;
|
|
7
|
+
currentMethod: MFAInputMethod;
|
|
8
|
+
methods: MFAInputMethod[];
|
|
9
|
+
areaCode?: string;
|
|
10
|
+
checkRepeat?: boolean;
|
|
11
|
+
checkExist?: boolean;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare function MFAFormItemIdentify(props: MFAFormItemIdentifyProps): JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InputProps } from 'shim-antd';
|
|
2
|
+
import { React } from 'shim-react';
|
|
3
|
+
import { MfaLoginMethods } from '../../../Type/application';
|
|
4
|
+
export interface InputIdentifyProps extends InputProps {
|
|
5
|
+
methods: MfaLoginMethods[];
|
|
6
|
+
}
|
|
7
|
+
export declare const InputIdentify: React.FC<InputIdentifyProps>;
|
|
@@ -8,6 +8,8 @@ export interface LoginConfig extends IG2Config {
|
|
|
8
8
|
disableRegister?: boolean;
|
|
9
9
|
defaultLoginMethod?: LoginMethods;
|
|
10
10
|
loginMethods?: LoginMethods[];
|
|
11
|
+
defaultLoginTab?: LoginMethods;
|
|
12
|
+
loginTabs?: LoginMethods[];
|
|
11
13
|
passwordLoginMethods?: string[];
|
|
12
14
|
socialConnections?: SocialConnectionProvider[];
|
|
13
15
|
socialConnectionsBtnShape?: 'default' | 'button' | 'icon';
|
|
@@ -7,7 +7,10 @@ export declare enum MfaBusinessAction {
|
|
|
7
7
|
VerifyFace = "verify-face",
|
|
8
8
|
AssociateFace = "associate-face",
|
|
9
9
|
PasskeyBind = "passkey-bind",
|
|
10
|
-
PasskeyVerify = "passkey-verify"
|
|
10
|
+
PasskeyVerify = "passkey-verify",
|
|
11
|
+
GetFaceLivenessSession = "get-face-liveness-session",
|
|
12
|
+
GetFaceLivenessResult = "get-face-liveness-result",
|
|
13
|
+
VerifyFaceLiveness = "verify-face-liveness"
|
|
11
14
|
}
|
|
12
15
|
export declare const authFlow: (action: MfaBusinessAction, content: any) => Promise<AuthingGuardResponse<any>>;
|
|
13
16
|
interface VerifySmsContent {
|
|
@@ -35,10 +38,20 @@ interface AssociateFaceContent {
|
|
|
35
38
|
isExternalPhoto?: boolean;
|
|
36
39
|
mfaToken?: string;
|
|
37
40
|
}
|
|
38
|
-
|
|
41
|
+
interface GetFaceLivenessSessionContent {
|
|
42
|
+
mfaToken?: string;
|
|
43
|
+
}
|
|
44
|
+
interface GetFaceLivenessResultContent {
|
|
45
|
+
sessionId: string;
|
|
46
|
+
mfaToken?: string;
|
|
47
|
+
}
|
|
48
|
+
type BindPasskeyContent = PublicKeyCredentialWithAttestationJSON & {
|
|
49
|
+
mfaToken?: string;
|
|
50
|
+
};
|
|
39
51
|
interface VerifyPasskeyContent {
|
|
40
52
|
credential: PublicKeyCredentialWithAssertionJSON;
|
|
41
53
|
ticket: string;
|
|
54
|
+
mfaToken?: string;
|
|
42
55
|
}
|
|
43
56
|
interface GetPasskeyBindChallengeParams {
|
|
44
57
|
mfaToken: string;
|
|
@@ -51,6 +64,22 @@ export declare const VerifySms: (content: VerifySmsContent) => Promise<AuthingGu
|
|
|
51
64
|
export declare const VerifyTotp: (content: VerifyTotpContent) => Promise<AuthingGuardResponse<any>>;
|
|
52
65
|
export declare const VerifyFace: (content: VerifyFaceContent) => Promise<AuthingGuardResponse<any>>;
|
|
53
66
|
export declare const AssociateFace: (content: AssociateFaceContent) => Promise<AuthingGuardResponse<any>>;
|
|
67
|
+
/**
|
|
68
|
+
* 获取 AWS 活体检测 Session
|
|
69
|
+
* POST /api/v2/mfa/face/liveness/session
|
|
70
|
+
*/
|
|
71
|
+
export declare const GetFaceLivenessSession: (content: GetFaceLivenessSessionContent) => Promise<AuthingGuardResponse<any>>;
|
|
72
|
+
/**
|
|
73
|
+
* 获取 AWS 活体检测结果
|
|
74
|
+
* GET /api/v2/mfa/face/liveness/result?sessionId=xxx
|
|
75
|
+
*/
|
|
76
|
+
export declare const GetFaceLivenessResult: (content: GetFaceLivenessResultContent) => Promise<AuthingGuardResponse<any>>;
|
|
77
|
+
/**
|
|
78
|
+
* AWS 临时凭证接口(占位)
|
|
79
|
+
* GET /api/credentials
|
|
80
|
+
* TODO: 后端需要实现此接口
|
|
81
|
+
*/
|
|
82
|
+
export declare const GetAwsCredentials: () => Promise<AuthingGuardResponse<any>>;
|
|
54
83
|
export declare const GetPasskeyBindChallenge: (content: GetPasskeyBindChallengeParams) => Promise<AuthingGuardResponse<CredentialCreationOptionsJSON>>;
|
|
55
84
|
export declare const GetPasskeyVerifyChallenge: (content: GetPasskeyVerifyChallengeParams) => Promise<AuthingGuardResponse<CredentialRequestOptionsJSON & {
|
|
56
85
|
ticket: string;
|
|
@@ -63,5 +92,7 @@ export declare const useMfaBusinessRequest: () => {
|
|
|
63
92
|
"associate-face": (content: AssociateFaceContent) => Promise<AuthingGuardResponse<any>>;
|
|
64
93
|
"passkey-bind": (content: BindPasskeyContent) => Promise<AuthingGuardResponse<any>> | null;
|
|
65
94
|
"passkey-verify": (content: VerifyPasskeyContent) => Promise<AuthingGuardResponse<any>> | null;
|
|
95
|
+
"get-face-liveness-session": (content: GetFaceLivenessSessionContent) => Promise<AuthingGuardResponse<any>>;
|
|
96
|
+
"get-face-liveness-result": (content: GetFaceLivenessResultContent) => Promise<AuthingGuardResponse<any>>;
|
|
66
97
|
};
|
|
67
98
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@aws-amplify/ui-react/styles.css';
|
|
3
|
+
interface AwsFaceLivenessDetectorProps {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
region?: string;
|
|
6
|
+
onAnalysisComplete?: () => void | Promise<void>;
|
|
7
|
+
onError?: (error: any) => void;
|
|
8
|
+
credentials?: {
|
|
9
|
+
accessKeyId: string;
|
|
10
|
+
secretAccessKey: string;
|
|
11
|
+
sessionToken: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* AWS Face Liveness 检测组件
|
|
16
|
+
*/
|
|
17
|
+
export declare const AwsFaceLivenessDetector: React.FC<AwsFaceLivenessDetectorProps>;
|
|
18
|
+
export default AwsFaceLivenessDetector;
|
|
@@ -8,7 +8,6 @@ interface BindPasskeyProps {
|
|
|
8
8
|
interface VerifyPasskeyProps {
|
|
9
9
|
mfaToken: string;
|
|
10
10
|
mfaLogin: (code: any, data: any, message?: string) => void;
|
|
11
|
-
mfaConfigsMap: Map<MFAType, boolean>;
|
|
12
11
|
}
|
|
13
12
|
export type MFAPasskeyProps = BindPasskeyProps & VerifyPasskeyProps & {
|
|
14
13
|
passkeyEnabled: boolean;
|
|
@@ -9,8 +9,5 @@ export interface SendCodeByEmailProps extends InputProps {
|
|
|
9
9
|
fieldName?: string;
|
|
10
10
|
autoSubmit?: boolean;
|
|
11
11
|
scene: EmailScene;
|
|
12
|
-
captchaCode?: string;
|
|
13
|
-
onSendCodeError?: any;
|
|
14
|
-
codeFieldName?: string;
|
|
15
12
|
}
|
|
16
13
|
export declare const SendCodeByEmail: React.FC<SendCodeByEmailProps>;
|
|
@@ -17,7 +17,8 @@ export declare enum LoginMethods {
|
|
|
17
17
|
WECHATWORKAGENCYQRCONNECT = "wechatwork-agency-qrcode",// 代开发形式的内部应用
|
|
18
18
|
DingTalkQrcode = "dingtalk-qrcode",//钉钉扫码
|
|
19
19
|
Passkey = "passkey",// passkey
|
|
20
|
-
ZJZWFWQrcode = "zjzwfw-qrcode"
|
|
20
|
+
ZJZWFWQrcode = "zjzwfw-qrcode",// 浙江政务钉
|
|
21
|
+
MFA = "mfa"
|
|
21
22
|
}
|
|
22
23
|
export declare enum OIDCConnectionMode {
|
|
23
24
|
FRONT_CHANNEL = "FRONT_CHANNEL",
|
|
@@ -181,6 +182,9 @@ export interface ApplicationVerifyCodeTabConfig {
|
|
|
181
182
|
validRegisterMethods?: string[];
|
|
182
183
|
validLoginMethods?: string[];
|
|
183
184
|
}
|
|
185
|
+
export interface ApplicationMfaTabConfig {
|
|
186
|
+
validLoginMethods?: MfaLoginMethods[];
|
|
187
|
+
}
|
|
184
188
|
export interface Agreement {
|
|
185
189
|
id: number;
|
|
186
190
|
title: string;
|
|
@@ -191,6 +195,7 @@ export interface Agreement {
|
|
|
191
195
|
export type PasswordLoginMethods = 'username-password' | 'email-password' | 'phone-password';
|
|
192
196
|
export type VerifyLoginMethods = 'email-code' | 'phone-code';
|
|
193
197
|
export type ComplateFiledsPlace = 'register' | 'login';
|
|
198
|
+
export type MfaLoginMethods = 'email-mfa' | 'phone-mfa';
|
|
194
199
|
export interface TabFieldsI18nItem {
|
|
195
200
|
key: string;
|
|
196
201
|
label: string;
|
|
@@ -313,6 +318,7 @@ export interface ApplicationConfig {
|
|
|
313
318
|
verifyCode?: LoginTypeI18nProps;
|
|
314
319
|
ad?: LoginTypeI18nProps;
|
|
315
320
|
ldap?: LoginTypeI18nProps;
|
|
321
|
+
mfa?: LoginTypeI18nProps;
|
|
316
322
|
};
|
|
317
323
|
idpLayout?: {
|
|
318
324
|
maxConns: number;
|
|
@@ -324,6 +330,7 @@ export interface ApplicationConfig {
|
|
|
324
330
|
oidcConfig: OidcClientMetadata;
|
|
325
331
|
passwordTabConfig: ApplicationPasswordTabConfig;
|
|
326
332
|
verifyCodeTabConfig?: ApplicationVerifyCodeTabConfig;
|
|
333
|
+
mfaTabConfig?: ApplicationMfaTabConfig;
|
|
327
334
|
agreementEnabled: boolean;
|
|
328
335
|
agreements: Agreement[];
|
|
329
336
|
customPasswordStrength: any;
|
|
@@ -348,8 +355,6 @@ export interface ApplicationConfig {
|
|
|
348
355
|
enabledMailPwdRegisterValid?: boolean;
|
|
349
356
|
/** 是否开启邮箱域名匹配登录 */
|
|
350
357
|
enabledMatchEmailDomain?: boolean;
|
|
351
|
-
/** 注册是否开启账号类型选择 */
|
|
352
|
-
enableAccountTypeSelect?: boolean;
|
|
353
358
|
/**
|
|
354
359
|
* 登录注册排序
|
|
355
360
|
*/
|
|
@@ -410,23 +415,6 @@ export interface ApplicationConfig {
|
|
|
410
415
|
switch: 'OFF' | 'ON' | 'CONDON';
|
|
411
416
|
};
|
|
412
417
|
};
|
|
413
|
-
/** 注册阶段邮件安全配置 */
|
|
414
|
-
registerEmailConfig?: {
|
|
415
|
-
robot: {
|
|
416
|
-
switch: 'OFF' | 'ON' | 'CONDON';
|
|
417
|
-
};
|
|
418
|
-
};
|
|
419
|
-
/** 登录阶段邮件安全配置 */
|
|
420
|
-
loginEmailConfig?: {
|
|
421
|
-
robot: {
|
|
422
|
-
switch: 'OFF' | 'ON' | 'CONDON';
|
|
423
|
-
};
|
|
424
|
-
};
|
|
425
|
-
forgetPasswordEmailConfig?: {
|
|
426
|
-
robot: {
|
|
427
|
-
switch: 'OFF' | 'ON' | 'CONDON';
|
|
428
|
-
};
|
|
429
|
-
};
|
|
430
418
|
/** 特殊浏览器匹配字符串 */
|
|
431
419
|
specialBrowserSymbols?: string[];
|
|
432
420
|
resetPwdTipsConfig?: {
|
|
@@ -447,5 +435,4 @@ export interface ApplicationConfig {
|
|
|
447
435
|
title: I18nLang;
|
|
448
436
|
desc: I18nLang;
|
|
449
437
|
};
|
|
450
|
-
resetPwdSelectEmailPhone?: 'email' | 'phone' | 'email_and_phone';
|
|
451
438
|
}
|
|
@@ -61,6 +61,10 @@ export declare enum InputMethod {
|
|
|
61
61
|
EmailCode = "email-code",
|
|
62
62
|
PhoneCode = "phone-code"
|
|
63
63
|
}
|
|
64
|
+
export declare enum MFAInputMethod {
|
|
65
|
+
PhoneMfa = "phone-mfa",
|
|
66
|
+
EmailMfa = "email-mfa"
|
|
67
|
+
}
|
|
64
68
|
export declare enum GuardPageSene {
|
|
65
69
|
Global = "global"
|
|
66
70
|
}
|
|
@@ -52,9 +52,11 @@ export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string
|
|
|
52
52
|
disableResetPwd?: boolean | undefined;
|
|
53
53
|
defaultLoginMethod?: LoginMethods | undefined;
|
|
54
54
|
loginMethods?: LoginMethods[] | undefined;
|
|
55
|
+
defaultLoginTab?: LoginMethods | undefined;
|
|
56
|
+
loginTabs?: LoginMethods[] | undefined;
|
|
55
57
|
passwordLoginMethods?: string[] | undefined;
|
|
56
58
|
socialConnections?: import("../../Type").SocialConnectionProvider[] | undefined;
|
|
57
|
-
socialConnectionsBtnShape?: "button" | "
|
|
59
|
+
socialConnectionsBtnShape?: "button" | "default" | "icon" | undefined;
|
|
58
60
|
enterpriseConnections?: string[] | undefined;
|
|
59
61
|
qrCodeScanOptions?: {
|
|
60
62
|
extIdpConnId?: string | undefined;
|
|
@@ -164,7 +164,5 @@ export declare const useGuardDefaultLanguage: () => Lang;
|
|
|
164
164
|
export declare const useGuardTenantProvider: () => MultipleTenant | undefined;
|
|
165
165
|
/** 当前人机验证策略 */
|
|
166
166
|
export declare const useRobotVerify: () => "always_enable" | "disable" | "condition_set";
|
|
167
|
-
/**
|
|
168
|
-
export declare const
|
|
169
|
-
/** 当前应用邮件是否开启人机验证策略 */
|
|
170
|
-
export declare const useEmailCaptchaCheck: (sence: 'login' | 'register' | 'forget-password') => boolean;
|
|
167
|
+
/** 当前应用是否开启人机验证策略 */
|
|
168
|
+
export declare const useCaptchaCheck: (sence: 'login' | 'register' | 'forget-password') => boolean;
|
package/package.json
CHANGED