@authing/guard-shim-react 4.5.47-alpha.9 → 4.5.47-bg.10

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.
@@ -8,6 +8,7 @@
8
8
  * 再次打开页面时,初始化时先根据 FE 自定义的 LoginWay 跳转到不同的 tab 下(way)下使用 account 进行回填。TODO: 这里也可优化,应该在登录成功时候就进行 LoginWay 的格式化,而非转来转去。(但是这样无法直观的体现是哪种方式进行登录)
9
9
  */
10
10
  import { SelectOptions } from '../../../Login/multipleAccounts/panel';
11
+ export declare const LAST_USED_IDP = "__authing_last_used_idp__";
11
12
  export declare const QR_CODE_WAY: LoginWay[];
12
13
  /**
13
14
  * 登录时所有支持的登录列表(前端定义列表)
@@ -117,6 +118,7 @@ declare class MultipleAccount {
117
118
  private memberState;
118
119
  /**
119
120
  * 二维码登录时的ID
121
+ *「loginWay = "social"」社会化身份源登录时 其 id 表示为「唯一标识」
120
122
  */
121
123
  private qrCodeId?;
122
124
  /**
@@ -137,6 +139,10 @@ declare class MultipleAccount {
137
139
  * 是否开启国际化短信
138
140
  */
139
141
  private isInternationSms?;
142
+ /**
143
+ * 社会化登录列表 主要是为了做「置顶上次登录」
144
+ */
145
+ private socialLoginWays?;
140
146
  constructor();
141
147
  /**
142
148
  * 页面首次加载时初始化 Store
@@ -238,6 +244,7 @@ declare class MultipleAccount {
238
244
  * 外部暴露方法
239
245
  */
240
246
  getStore: () => {
247
+ getSocialLoginWays: () => User[] | undefined;
241
248
  initStore: (appId: string, options: {
242
249
  serverSideLoginMethods: LoginWay[];
243
250
  isInternationSms: boolean;
@@ -282,6 +289,7 @@ declare const useSelectAccounts: ({ appId, finallyConfig }: {
282
289
  finallyConfig?: any;
283
290
  }) => {
284
291
  instance: {
292
+ getSocialLoginWays: () => User[] | undefined;
285
293
  initStore: (appId: string, options: {
286
294
  serverSideLoginMethods: LoginWay[];
287
295
  isInternationSms: boolean;
@@ -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>;
@@ -0,0 +1,2 @@
1
+ declare const LoginWithMFA: (props: any) => JSX.Element;
2
+ export { LoginWithMFA };
@@ -27,6 +27,7 @@ declare function useLoginAccountBackFill(options: {
27
27
  declare function useLoginSelectAccount(setLoginWay: React.Dispatch<any>): {
28
28
  isMultipleAccount: boolean;
29
29
  multipleInstance: {
30
+ getSocialLoginWays: () => import("../../Guard/core/hooks/useMultipleAccounts").User[] | undefined;
30
31
  initStore: (appId: string, options: {
31
32
  serverSideLoginMethods: LoginWay[];
32
33
  isInternationSms: boolean;
@@ -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';
@@ -1 +1,5 @@
1
+ import { ApplicationConfig } from '../../../Type/application';
1
2
  export declare const IdpButton: (props: any) => JSX.Element | null;
3
+ export declare const MoreIdpButton: (props: {
4
+ idps: ApplicationConfig['identityProviders'];
5
+ }) => JSX.Element;
@@ -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
- type BindPasskeyContent = PublicKeyCredentialWithAttestationJSON;
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;
@@ -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;
@@ -285,9 +290,12 @@ export interface ApplicationConfig {
285
290
  protocol: Protocol;
286
291
  displayName: string;
287
292
  logo: string;
293
+ id: string;
288
294
  config: ISamlConnectionConfig | OIDCConnectionConfig | ICasConnectionConfig | IAzureAdConnectionConfig | IOAuthConnectionConfig;
289
295
  /** 是否开启内嵌模式 */
290
296
  embedded?: boolean;
297
+ tags?: string[];
298
+ tagsStatus?: boolean;
291
299
  }[];
292
300
  ssoPageComponentDisplay: {
293
301
  autoRegisterThenLoginHintInfo: boolean;
@@ -310,12 +318,19 @@ export interface ApplicationConfig {
310
318
  verifyCode?: LoginTypeI18nProps;
311
319
  ad?: LoginTypeI18nProps;
312
320
  ldap?: LoginTypeI18nProps;
321
+ mfa?: LoginTypeI18nProps;
322
+ };
323
+ idpLayout?: {
324
+ maxConns: number;
325
+ topLastUsed: boolean;
326
+ customMoreI18n: I18nLang;
313
327
  };
314
328
  };
315
329
  protocol: Protocol;
316
330
  oidcConfig: OidcClientMetadata;
317
331
  passwordTabConfig: ApplicationPasswordTabConfig;
318
332
  verifyCodeTabConfig?: ApplicationVerifyCodeTabConfig;
333
+ mfaTabConfig?: ApplicationMfaTabConfig;
319
334
  agreementEnabled: boolean;
320
335
  agreements: Agreement[];
321
336
  customPasswordStrength: any;
@@ -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" | "icon" | "default" | undefined;
59
+ socialConnectionsBtnShape?: "button" | "default" | "icon" | undefined;
58
60
  enterpriseConnections?: string[] | undefined;
59
61
  qrCodeScanOptions?: {
60
62
  extIdpConnId?: string | undefined;
@@ -111,6 +111,7 @@ export declare const useGuardAccountSelectInstance: () => {
111
111
  * 多账号 store 实例
112
112
  */
113
113
  instance?: {
114
+ getSocialLoginWays: () => import("../Guard/core/hooks/useMultipleAccounts").User[] | undefined;
114
115
  initStore: (appId: string, options: {
115
116
  serverSideLoginMethods: import("../Guard/core/hooks/useMultipleAccounts").LoginWay[];
116
117
  isInternationSms: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/guard-shim-react",
3
- "version": "4.5.47-alpha.9",
3
+ "version": "4.5.47-bg.10",
4
4
  "description": "Guard shim for react 16 / 17, only be used to internal",
5
5
  "types": "dist/typings/src/index.d.ts",
6
6
  "module": "dist/guard.min.js",