@firebase/auth 1.7.1-canary.e1a7764cf → 1.7.1-passkey-preview.103ead202

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.
Files changed (199) hide show
  1. package/dist/auth-public.d.ts +60 -15
  2. package/dist/auth.d.ts +64 -16
  3. package/dist/browser-cjs/{index-b554a82d.js → index-763ce1de.js} +261 -17
  4. package/dist/browser-cjs/index-763ce1de.js.map +1 -0
  5. package/dist/browser-cjs/index.js +4 -1
  6. package/dist/browser-cjs/index.js.map +1 -1
  7. package/dist/browser-cjs/internal.js +4 -1
  8. package/dist/browser-cjs/internal.js.map +1 -1
  9. package/dist/browser-cjs/src/api/account_management/account.d.ts +2 -0
  10. package/dist/browser-cjs/src/api/account_management/passkey.d.ts +83 -0
  11. package/dist/browser-cjs/src/api/account_management/passkey.test.d.ts +17 -0
  12. package/dist/browser-cjs/src/api/index.d.ts +5 -1
  13. package/dist/browser-cjs/src/core/index.d.ts +1 -0
  14. package/dist/browser-cjs/src/core/strategies/email.d.ts +3 -5
  15. package/dist/browser-cjs/src/core/strategies/email_and_password.d.ts +4 -6
  16. package/dist/browser-cjs/src/core/strategies/passkey.d.ts +41 -0
  17. package/dist/browser-cjs/src/core/strategies/passkey.test.d.ts +17 -0
  18. package/dist/browser-cjs/src/core/user/account_info.d.ts +1 -3
  19. package/dist/browser-cjs/src/core/user/user_impl.d.ts +2 -1
  20. package/dist/browser-cjs/src/model/enums.d.ts +6 -2
  21. package/dist/browser-cjs/src/model/public_types.d.ts +18 -1
  22. package/dist/browser-cjs/src/model/user.d.ts +3 -0
  23. package/dist/cordova/index.js +2 -2
  24. package/dist/cordova/internal.js +2 -2
  25. package/dist/cordova/{popup_redirect-89a4178c.js → popup_redirect-619ee864.js} +331 -18
  26. package/dist/cordova/popup_redirect-619ee864.js.map +1 -0
  27. package/dist/cordova/src/api/account_management/account.d.ts +2 -0
  28. package/dist/cordova/src/api/account_management/passkey.d.ts +83 -0
  29. package/dist/cordova/src/api/account_management/passkey.test.d.ts +17 -0
  30. package/dist/cordova/src/api/index.d.ts +5 -1
  31. package/dist/cordova/src/core/index.d.ts +1 -0
  32. package/dist/cordova/src/core/strategies/email.d.ts +3 -5
  33. package/dist/cordova/src/core/strategies/email_and_password.d.ts +4 -6
  34. package/dist/cordova/src/core/strategies/passkey.d.ts +41 -0
  35. package/dist/cordova/src/core/strategies/passkey.test.d.ts +17 -0
  36. package/dist/cordova/src/core/user/account_info.d.ts +1 -3
  37. package/dist/cordova/src/core/user/user_impl.d.ts +2 -1
  38. package/dist/cordova/src/model/enums.d.ts +6 -2
  39. package/dist/cordova/src/model/public_types.d.ts +18 -1
  40. package/dist/cordova/src/model/user.d.ts +3 -0
  41. package/dist/esm2017/{index-456eaf5d.js → index-e517538d.js} +259 -18
  42. package/dist/esm2017/index-e517538d.js.map +1 -0
  43. package/dist/esm2017/index.js +1 -1
  44. package/dist/esm2017/internal.js +2 -2
  45. package/dist/esm2017/src/api/account_management/account.d.ts +2 -0
  46. package/dist/esm2017/src/api/account_management/passkey.d.ts +83 -0
  47. package/dist/esm2017/src/api/account_management/passkey.test.d.ts +17 -0
  48. package/dist/esm2017/src/api/index.d.ts +5 -1
  49. package/dist/esm2017/src/core/index.d.ts +1 -0
  50. package/dist/esm2017/src/core/strategies/email.d.ts +3 -5
  51. package/dist/esm2017/src/core/strategies/email_and_password.d.ts +4 -6
  52. package/dist/esm2017/src/core/strategies/passkey.d.ts +41 -0
  53. package/dist/esm2017/src/core/strategies/passkey.test.d.ts +17 -0
  54. package/dist/esm2017/src/core/user/account_info.d.ts +1 -3
  55. package/dist/esm2017/src/core/user/user_impl.d.ts +2 -1
  56. package/dist/esm2017/src/model/enums.d.ts +6 -2
  57. package/dist/esm2017/src/model/public_types.d.ts +18 -1
  58. package/dist/esm2017/src/model/user.d.ts +3 -0
  59. package/dist/esm5/{index-7c43a070.js → index-5377e4d7.js} +331 -18
  60. package/dist/esm5/index-5377e4d7.js.map +1 -0
  61. package/dist/esm5/index.js +1 -1
  62. package/dist/esm5/internal.js +2 -2
  63. package/dist/esm5/src/api/account_management/account.d.ts +2 -0
  64. package/dist/esm5/src/api/account_management/passkey.d.ts +83 -0
  65. package/dist/esm5/src/api/account_management/passkey.test.d.ts +17 -0
  66. package/dist/esm5/src/api/index.d.ts +5 -1
  67. package/dist/esm5/src/core/index.d.ts +1 -0
  68. package/dist/esm5/src/core/strategies/email.d.ts +3 -5
  69. package/dist/esm5/src/core/strategies/email_and_password.d.ts +4 -6
  70. package/dist/esm5/src/core/strategies/passkey.d.ts +41 -0
  71. package/dist/esm5/src/core/strategies/passkey.test.d.ts +17 -0
  72. package/dist/esm5/src/core/user/account_info.d.ts +1 -3
  73. package/dist/esm5/src/core/user/user_impl.d.ts +2 -1
  74. package/dist/esm5/src/model/enums.d.ts +6 -2
  75. package/dist/esm5/src/model/public_types.d.ts +18 -1
  76. package/dist/esm5/src/model/user.d.ts +3 -0
  77. package/dist/index.webworker.esm5.js +330 -17
  78. package/dist/index.webworker.esm5.js.map +1 -1
  79. package/dist/node/index.js +4 -1
  80. package/dist/node/index.js.map +1 -1
  81. package/dist/node/internal.js +4 -1
  82. package/dist/node/internal.js.map +1 -1
  83. package/dist/node/src/api/account_management/account.d.ts +2 -0
  84. package/dist/node/src/api/account_management/passkey.d.ts +83 -0
  85. package/dist/node/src/api/account_management/passkey.test.d.ts +17 -0
  86. package/dist/node/src/api/index.d.ts +5 -1
  87. package/dist/node/src/core/index.d.ts +1 -0
  88. package/dist/node/src/core/strategies/email.d.ts +3 -5
  89. package/dist/node/src/core/strategies/email_and_password.d.ts +4 -6
  90. package/dist/node/src/core/strategies/passkey.d.ts +41 -0
  91. package/dist/node/src/core/strategies/passkey.test.d.ts +17 -0
  92. package/dist/node/src/core/user/account_info.d.ts +1 -3
  93. package/dist/node/src/core/user/user_impl.d.ts +2 -1
  94. package/dist/node/src/model/enums.d.ts +6 -2
  95. package/dist/node/src/model/public_types.d.ts +18 -1
  96. package/dist/node/src/model/user.d.ts +3 -0
  97. package/dist/node/{totp-38aba8fd.js → totp-e59979fc.js} +333 -17
  98. package/dist/node/totp-e59979fc.js.map +1 -0
  99. package/dist/node-esm/index.js +1 -1
  100. package/dist/node-esm/internal.js +2 -2
  101. package/dist/node-esm/src/api/account_management/account.d.ts +2 -0
  102. package/dist/node-esm/src/api/account_management/passkey.d.ts +83 -0
  103. package/dist/node-esm/src/api/account_management/passkey.test.d.ts +17 -0
  104. package/dist/node-esm/src/api/index.d.ts +5 -1
  105. package/dist/node-esm/src/core/index.d.ts +1 -0
  106. package/dist/node-esm/src/core/strategies/email.d.ts +3 -5
  107. package/dist/node-esm/src/core/strategies/email_and_password.d.ts +4 -6
  108. package/dist/node-esm/src/core/strategies/passkey.d.ts +41 -0
  109. package/dist/node-esm/src/core/strategies/passkey.test.d.ts +17 -0
  110. package/dist/node-esm/src/core/user/account_info.d.ts +1 -3
  111. package/dist/node-esm/src/core/user/user_impl.d.ts +2 -1
  112. package/dist/node-esm/src/model/enums.d.ts +6 -2
  113. package/dist/node-esm/src/model/public_types.d.ts +18 -1
  114. package/dist/node-esm/src/model/user.d.ts +3 -0
  115. package/dist/node-esm/{totp-e448e7fe.js → totp-86acc588.js} +259 -18
  116. package/dist/node-esm/totp-86acc588.js.map +1 -0
  117. package/dist/rn/{index-985afdb4.js → index-551e6aca.js} +333 -17
  118. package/dist/rn/index-551e6aca.js.map +1 -0
  119. package/dist/rn/index.js +4 -1
  120. package/dist/rn/index.js.map +1 -1
  121. package/dist/rn/internal.js +4 -1
  122. package/dist/rn/internal.js.map +1 -1
  123. package/dist/rn/src/api/account_management/account.d.ts +2 -0
  124. package/dist/rn/src/api/account_management/passkey.d.ts +83 -0
  125. package/dist/rn/src/api/account_management/passkey.test.d.ts +17 -0
  126. package/dist/rn/src/api/index.d.ts +5 -1
  127. package/dist/rn/src/core/index.d.ts +1 -0
  128. package/dist/rn/src/core/strategies/email.d.ts +3 -5
  129. package/dist/rn/src/core/strategies/email_and_password.d.ts +4 -6
  130. package/dist/rn/src/core/strategies/passkey.d.ts +41 -0
  131. package/dist/rn/src/core/strategies/passkey.test.d.ts +17 -0
  132. package/dist/rn/src/core/user/account_info.d.ts +1 -3
  133. package/dist/rn/src/core/user/user_impl.d.ts +2 -1
  134. package/dist/rn/src/model/enums.d.ts +6 -2
  135. package/dist/rn/src/model/public_types.d.ts +18 -1
  136. package/dist/rn/src/model/user.d.ts +3 -0
  137. package/dist/src/api/account_management/account.d.ts +2 -0
  138. package/dist/src/api/account_management/passkey.d.ts +83 -0
  139. package/dist/src/api/account_management/passkey.test.d.ts +17 -0
  140. package/dist/src/api/index.d.ts +5 -1
  141. package/dist/src/core/index.d.ts +1 -0
  142. package/dist/src/core/strategies/email.d.ts +3 -5
  143. package/dist/src/core/strategies/email_and_password.d.ts +4 -6
  144. package/dist/src/core/strategies/passkey.d.ts +41 -0
  145. package/dist/src/core/strategies/passkey.test.d.ts +17 -0
  146. package/dist/src/core/user/account_info.d.ts +1 -3
  147. package/dist/src/core/user/user_impl.d.ts +2 -1
  148. package/dist/src/model/enums.d.ts +6 -2
  149. package/dist/src/model/public_types.d.ts +18 -1
  150. package/dist/src/model/user.d.ts +3 -0
  151. package/dist/web-extension-cjs/index.js +4 -1
  152. package/dist/web-extension-cjs/index.js.map +1 -1
  153. package/dist/web-extension-cjs/internal.js +4 -1
  154. package/dist/web-extension-cjs/internal.js.map +1 -1
  155. package/dist/web-extension-cjs/{register-e3ac7adf.js → register-84d046a5.js} +261 -17
  156. package/dist/web-extension-cjs/register-84d046a5.js.map +1 -0
  157. package/dist/web-extension-cjs/src/api/account_management/account.d.ts +2 -0
  158. package/dist/web-extension-cjs/src/api/account_management/passkey.d.ts +83 -0
  159. package/dist/web-extension-cjs/src/api/account_management/passkey.test.d.ts +17 -0
  160. package/dist/web-extension-cjs/src/api/index.d.ts +5 -1
  161. package/dist/web-extension-cjs/src/core/index.d.ts +1 -0
  162. package/dist/web-extension-cjs/src/core/strategies/email.d.ts +3 -5
  163. package/dist/web-extension-cjs/src/core/strategies/email_and_password.d.ts +4 -6
  164. package/dist/web-extension-cjs/src/core/strategies/passkey.d.ts +41 -0
  165. package/dist/web-extension-cjs/src/core/strategies/passkey.test.d.ts +17 -0
  166. package/dist/web-extension-cjs/src/core/user/account_info.d.ts +1 -3
  167. package/dist/web-extension-cjs/src/core/user/user_impl.d.ts +2 -1
  168. package/dist/web-extension-cjs/src/model/enums.d.ts +6 -2
  169. package/dist/web-extension-cjs/src/model/public_types.d.ts +18 -1
  170. package/dist/web-extension-cjs/src/model/user.d.ts +3 -0
  171. package/dist/web-extension-esm2017/index.js +2 -2
  172. package/dist/web-extension-esm2017/internal.js +2 -2
  173. package/dist/web-extension-esm2017/{register-ffa8f4d2.js → register-49f5fb7d.js} +259 -18
  174. package/dist/web-extension-esm2017/register-49f5fb7d.js.map +1 -0
  175. package/dist/web-extension-esm2017/src/api/account_management/account.d.ts +2 -0
  176. package/dist/web-extension-esm2017/src/api/account_management/passkey.d.ts +83 -0
  177. package/dist/web-extension-esm2017/src/api/account_management/passkey.test.d.ts +17 -0
  178. package/dist/web-extension-esm2017/src/api/index.d.ts +5 -1
  179. package/dist/web-extension-esm2017/src/core/index.d.ts +1 -0
  180. package/dist/web-extension-esm2017/src/core/strategies/email.d.ts +3 -5
  181. package/dist/web-extension-esm2017/src/core/strategies/email_and_password.d.ts +4 -6
  182. package/dist/web-extension-esm2017/src/core/strategies/passkey.d.ts +41 -0
  183. package/dist/web-extension-esm2017/src/core/strategies/passkey.test.d.ts +17 -0
  184. package/dist/web-extension-esm2017/src/core/user/account_info.d.ts +1 -3
  185. package/dist/web-extension-esm2017/src/core/user/user_impl.d.ts +2 -1
  186. package/dist/web-extension-esm2017/src/model/enums.d.ts +6 -2
  187. package/dist/web-extension-esm2017/src/model/public_types.d.ts +18 -1
  188. package/dist/web-extension-esm2017/src/model/user.d.ts +3 -0
  189. package/package.json +6 -6
  190. package/dist/browser-cjs/index-b554a82d.js.map +0 -1
  191. package/dist/cordova/popup_redirect-89a4178c.js.map +0 -1
  192. package/dist/esm2017/index-456eaf5d.js.map +0 -1
  193. package/dist/esm5/index-7c43a070.js.map +0 -1
  194. package/dist/node/totp-38aba8fd.js.map +0 -1
  195. package/dist/node-esm/totp-e448e7fe.js.map +0 -1
  196. package/dist/rn/index-985afdb4.js.map +0 -1
  197. package/dist/web-extension-cjs/register-e3ac7adf.js.map +0 -1
  198. package/dist/web-extension-esm2017/package.json +0 -1
  199. package/dist/web-extension-esm2017/register-ffa8f4d2.js.map +0 -1
@@ -15,6 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { MfaEnrollment } from './mfa';
18
+ import { PasskeyInfo } from './passkey';
18
19
  import { Auth } from '../../model/public_types';
19
20
  export interface DeleteAccountRequest {
20
21
  idToken: string;
@@ -49,6 +50,7 @@ export interface APIUserInfo {
49
50
  passwordHash?: string;
50
51
  providerUserInfo?: ProviderUserInfo[];
51
52
  mfaInfo?: MfaEnrollment[];
53
+ passkeyInfo?: PasskeyInfo[];
52
54
  }
53
55
  export interface GetAccountInfoRequest {
54
56
  idToken: string;
@@ -0,0 +1,83 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { Auth } from '../../model/public_types';
18
+ import { IdTokenResponse } from '../../model/id_token';
19
+ interface AuthenticatorResponseJSON {
20
+ clientDataJSON: string;
21
+ attestationObject?: string;
22
+ authenticatorData?: string;
23
+ signature?: string;
24
+ userHandle?: string;
25
+ }
26
+ interface PublicKeyCredentialJSON {
27
+ id: string;
28
+ type: string;
29
+ rawId: string;
30
+ response: AuthenticatorResponseJSON;
31
+ }
32
+ export declare function publicKeyCredentialToJSON(pubKeyCred: PublicKeyCredential): PublicKeyCredentialJSON;
33
+ export interface PasskeyInfo {
34
+ credentialId: string;
35
+ name?: string;
36
+ }
37
+ export interface StartPasskeyEnrollmentRequest {
38
+ idToken?: string;
39
+ tenantId?: string;
40
+ }
41
+ export interface StartPasskeyEnrollmentResponse {
42
+ credentialCreationOptions?: PublicKeyCredentialCreationOptions;
43
+ }
44
+ export declare function startPasskeyEnrollment(auth: Auth, request: StartPasskeyEnrollmentRequest): Promise<StartPasskeyEnrollmentResponse>;
45
+ export interface FinalizePasskeyEnrollmentRequest {
46
+ idToken?: string;
47
+ tenantId?: string;
48
+ authenticatorRegistrationResponse?: PublicKeyCredentialJSON;
49
+ name?: string;
50
+ displayName?: string;
51
+ }
52
+ export interface FinalizePasskeyEnrollmentResponse extends IdTokenResponse {
53
+ localId: string;
54
+ idToken?: string;
55
+ refreshToken?: string;
56
+ }
57
+ export declare function finalizePasskeyEnrollment(auth: Auth, request: FinalizePasskeyEnrollmentRequest): Promise<FinalizePasskeyEnrollmentResponse>;
58
+ export interface StartPasskeySignInRequest {
59
+ tenantId?: string;
60
+ }
61
+ export interface StartPasskeySignInResponse extends IdTokenResponse {
62
+ credentialRequestOptions: PublicKeyCredentialRequestOptions;
63
+ }
64
+ export declare function startPasskeySignIn(auth: Auth, request: StartPasskeySignInRequest): Promise<StartPasskeySignInResponse>;
65
+ export interface FinalizePasskeySignInRequest {
66
+ tenantId?: string;
67
+ authenticatorAuthenticationResponse?: PublicKeyCredentialJSON;
68
+ name?: string;
69
+ displayName?: string;
70
+ }
71
+ export interface FinalizePasskeySignInResponse extends IdTokenResponse {
72
+ idToken?: string;
73
+ refreshToken?: string;
74
+ }
75
+ export declare function finalizePasskeySignIn(auth: Auth, request: FinalizePasskeySignInRequest): Promise<FinalizePasskeySignInResponse>;
76
+ export interface PasskeyUnenrollRequest {
77
+ idToken?: string;
78
+ deletePasskey: string[];
79
+ }
80
+ export interface PasskeyUnenrollResponse {
81
+ }
82
+ export declare function passkeyUnenroll(auth: Auth, request: PasskeyUnenrollRequest): Promise<PasskeyUnenrollResponse>;
83
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -56,7 +56,11 @@ export declare const enum Endpoint {
56
56
  GET_RECAPTCHA_CONFIG = "/v2/recaptchaConfig",
57
57
  GET_PASSWORD_POLICY = "/v2/passwordPolicy",
58
58
  TOKEN = "/v1/token",
59
- REVOKE_TOKEN = "/v2/accounts:revokeToken"
59
+ REVOKE_TOKEN = "/v2/accounts:revokeToken",
60
+ START_PASSKEY_ENROLLMENT = "/v2/accounts/passkeyEnrollment:start",
61
+ FINALIZE_PASSKEY_ENROLLMENT = "/v2/accounts/passkeyEnrollment:finalize",
62
+ START_PASSKEY_SIGNIN = "/v2/accounts/passkeySignIn:start",
63
+ FINALIZE_PASSKEY_SIGNIN = "/v2/accounts/passkeySignIn:finalize"
60
64
  }
61
65
  export declare const enum RecaptchaClientType {
62
66
  WEB = "CLIENT_TYPE_WEB",
@@ -209,6 +209,7 @@ export { signInWithCustomToken } from './strategies/custom_token';
209
209
  export { sendPasswordResetEmail, confirmPasswordReset, applyActionCode, checkActionCode, verifyPasswordResetCode, createUserWithEmailAndPassword, signInWithEmailAndPassword } from './strategies/email_and_password';
210
210
  export { sendSignInLinkToEmail, isSignInWithEmailLink, signInWithEmailLink } from './strategies/email_link';
211
211
  export { fetchSignInMethodsForEmail, sendEmailVerification, verifyBeforeUpdateEmail } from './strategies/email';
212
+ export { signInWithPasskey, enrollPasskey, unenrollPasskey } from './strategies/passkey';
212
213
  export { ActionCodeURL, parseActionCodeURL } from './action_code_url';
213
214
  export { updateProfile, updateEmail, updatePassword } from './user/account_info';
214
215
  export { getIdToken, getIdTokenResult } from './user/id_token_result';
@@ -17,9 +17,8 @@
17
17
  import { ActionCodeSettings, Auth, User } from '../../model/public_types';
18
18
  /**
19
19
  * Gets the list of possible sign in methods for the given email address. This method returns an
20
- * empty list when
21
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}
22
- * is enabled, irrespective of the number of authentication methods available for the given email.
20
+ * empty list when [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled, irrespective of the number of
21
+ * authentication methods available for the given email.
23
22
  *
24
23
  * @remarks
25
24
  * This is useful to differentiate methods of sign-in for the same provider, eg.
@@ -31,8 +30,7 @@ import { ActionCodeSettings, Auth, User } from '../../model/public_types';
31
30
  * @param email - The user's email address.
32
31
  *
33
32
  * Deprecated. Migrating off of this method is recommended as a security best-practice.
34
- * Learn more in the Identity Platform documentation for
35
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}.
33
+ * Learn more in the Identity Platform documentation for [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection).
36
34
  * @public
37
35
  */
38
36
  export declare function fetchSignInMethodsForEmail(auth: Auth, email: string): Promise<string[]>;
@@ -18,8 +18,7 @@ import { ActionCodeInfo, ActionCodeSettings, Auth, UserCredential } from '../../
18
18
  /**
19
19
  * Sends a password reset email to the given email address. This method does not throw an error when
20
20
  * there's no user account with the given email address and
21
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}
22
- * is enabled.
21
+ * [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled.
23
22
  *
24
23
  * @remarks
25
24
  * To complete the password reset, call {@link confirmPasswordReset} with the code supplied in
@@ -117,10 +116,9 @@ export declare function createUserWithEmailAndPassword(auth: Auth, email: string
117
116
  * Asynchronously signs in using an email and password.
118
117
  *
119
118
  * @remarks
120
- * Fails with an error if the email address and password do not match. When
121
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}
122
- * is enabled, this method fails with "auth/invalid-credential" in case of an invalid
123
- * email/password.
119
+ * Fails with an error if the email address and password do not match.
120
+ * When [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled,
121
+ * this method fails with "auth/invalid-credential" in case of an invalid email/password.
124
122
  *
125
123
  * This method is not supported on {@link Auth} instances created with a
126
124
  * {@link @firebase/app#FirebaseServerApp}.
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { Auth, User, UserCredential } from '../../model/public_types';
18
+ /**
19
+ * Signs in a user with a passkey. Use enrollPasskey to enroll a passkey credential for the current user.
20
+ * @param auth - The Firebase Auth instance.
21
+ * @param name - The user's name for passkey.
22
+ * @param manualSignUp - When false, automatically creates an anonymous user if a passkey credential does not exist. Defaults to false.
23
+ * @returns A promise that resolves with a `UserCredential` object.
24
+ */
25
+ export declare function signInWithPasskey(auth: Auth, name: string, manualSignUp?: boolean): Promise<UserCredential>;
26
+ /**
27
+ * Enrolls a passkey for the user account.
28
+ * @param user - The user to enroll the passkey for.
29
+ * @param name - The name associated with the passkey.
30
+ * @returns A promise that resolves with a `UserCredential` object.
31
+ * @public
32
+ */
33
+ export declare function enrollPasskey(user: User, name: string): Promise<UserCredential>;
34
+ /**
35
+ * Unenrolls the passkey corresponding to the specified credentialId.
36
+ * @param user - The user to unenroll the passkey for.
37
+ * @param credentialId - The ID of the passkey to unenroll.
38
+ * @returns A promise that resolves when the passkey is successfully unenrolled.
39
+ * @public
40
+ */
41
+ export declare function unenrollPasskey(user: User, credentialId: string): Promise<void>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -44,9 +44,7 @@ export declare function updateProfile(user: User, { displayName, photoURL: photo
44
44
  * @param user - The user.
45
45
  * @param newEmail - The new email address.
46
46
  *
47
- * Throws "auth/operation-not-allowed" error when
48
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}
49
- * is enabled.
47
+ * Throws "auth/operation-not-allowed" error when [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled.
50
48
  * Deprecated - Use {@link verifyBeforeUpdateEmail} instead.
51
49
  *
52
50
  * @public
@@ -14,7 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { IdTokenResult } from '../../model/public_types';
17
+ import { IdTokenResult, PasskeyInfo } from '../../model/public_types';
18
18
  import { NextFn } from '@firebase/util';
19
19
  import { APIUserInfo, GetAccountInfoResponse } from '../../api/account_management/account';
20
20
  import { FinalizeMfaResponse } from '../../api/authentication/mfa';
@@ -36,6 +36,7 @@ export declare class UserImpl implements UserInternal {
36
36
  tenantId: string | null;
37
37
  readonly metadata: UserMetadata;
38
38
  providerData: MutableUserInfo[];
39
+ enrolledPasskeys: PasskeyInfo[];
39
40
  displayName: string | null;
40
41
  email: string | null;
41
42
  phoneNumber: string | null;
@@ -36,7 +36,9 @@ export declare const enum ProviderId {
36
36
  /** Phone provider */
37
37
  PHONE = "phone",
38
38
  /** Twitter provider ID */
39
- TWITTER = "twitter.com"
39
+ TWITTER = "twitter.com",
40
+ /** Passkey provider */
41
+ PASSKEY = "passkey"
40
42
  }
41
43
  /**
42
44
  * Enumeration of supported sign-in methods.
@@ -58,7 +60,9 @@ export declare const enum SignInMethod {
58
60
  /** Phone sign in method */
59
61
  PHONE = "phone",
60
62
  /** Twitter sign in method */
61
- TWITTER = "twitter.com"
63
+ TWITTER = "twitter.com",
64
+ /** Passkey sign in method */
65
+ PASSKEY = "passkey"
62
66
  }
63
67
  /**
64
68
  * Enumeration of supported operation types.
@@ -52,7 +52,7 @@ export interface Config {
52
52
  /**
53
53
  * Interface representing reCAPTCHA parameters.
54
54
  *
55
- * See the {@link https://developers.google.com/recaptcha/docs/display#render_param | reCAPTCHA docs}
55
+ * See the [reCAPTCHA docs](https://developers.google.com/recaptcha/docs/display#render_param)
56
56
  * for the list of accepted parameters. All parameters are accepted except for `sitekey`: Firebase Auth
57
57
  * provisions a reCAPTCHA for each project and will configure the site key upon rendering.
58
58
  *
@@ -916,6 +916,10 @@ export interface User extends UserInfo {
916
916
  * Additional per provider such as displayName and profile information.
917
917
  */
918
918
  readonly providerData: UserInfo[];
919
+ /**
920
+ * An array of PasskeyInfo objects representing the passkeys that the user has enrolled.
921
+ */
922
+ readonly enrolledPasskeys: PasskeyInfo[];
919
923
  /**
920
924
  * Refresh token used to reauthenticate the user. Avoid using this directly and prefer
921
925
  * {@link User.getIdToken} to refresh the ID token instead.
@@ -1042,6 +1046,19 @@ export interface UserInfo {
1042
1046
  */
1043
1047
  readonly uid: string;
1044
1048
  }
1049
+ /**
1050
+ * Represents information about a passkey.
1051
+ */
1052
+ export interface PasskeyInfo {
1053
+ /**
1054
+ * The credential ID of the passkey.
1055
+ */
1056
+ readonly credentialId: string;
1057
+ /**
1058
+ * The name associated with the passkey.
1059
+ */
1060
+ readonly name?: string;
1061
+ }
1045
1062
  /**
1046
1063
  * Interface representing a user's metadata.
1047
1064
  *
@@ -24,6 +24,7 @@ import { UserMetadata } from '../core/user/user_metadata';
24
24
  import { AuthInternal } from './auth';
25
25
  import { IdTokenResponse, TaggedWithTokenResponse } from './id_token';
26
26
  import { ProviderId } from './enums';
27
+ import { PasskeyInfo } from '../api/account_management/passkey';
27
28
  export declare type MutableUserInfo = {
28
29
  -readonly [K in keyof UserInfo]: UserInfo[K];
29
30
  };
@@ -39,6 +40,7 @@ export interface UserParameters {
39
40
  emailVerified?: boolean | null;
40
41
  tenantId?: string | null;
41
42
  providerData?: MutableUserInfo[] | null;
43
+ enrolledPasskeys?: PasskeyInfo[];
42
44
  createdAt?: string | null;
43
45
  lastLoginAt?: string | null;
44
46
  }
@@ -60,6 +62,7 @@ export interface UserInternal extends User {
60
62
  tenantId: string | null;
61
63
  providerData: MutableUserInfo[];
62
64
  metadata: UserMetadata;
65
+ enrolledPasskeys: PasskeyInfo[];
63
66
  stsTokenManager: StsTokenManager;
64
67
  _redirectEventId?: string;
65
68
  _updateTokensIfNecessary(response: IdTokenResponse | FinalizeMfaResponse, reload?: boolean): Promise<void>;
@@ -1,5 +1,5 @@
1
- import { r as registerAuth, i as initializeAuth, a as indexedDBLocalPersistence, c as connectAuthEmulator } from './register-ffa8f4d2.js';
2
- export { Y as ActionCodeURL, m as AuthCredential, A as AuthErrorCodes, E as EmailAuthCredential, q as EmailAuthProvider, F as FacebookAuthProvider, t as GithubAuthProvider, G as GoogleAuthProvider, O as OAuthCredential, w as OAuthProvider, P as PhoneAuthCredential, S as SAMLAuthProvider, T as TotpMultiFactorGenerator, b as TotpSecret, x as TwitterAuthProvider, J as applyActionCode, e as beforeAuthStateChanged, K as checkActionCode, I as confirmPasswordReset, c as connectAuthEmulator, M as createUserWithEmailAndPassword, l as debugErrorMap, k as deleteUser, V as fetchSignInMethodsForEmail, a4 as getAdditionalUserInfo, a1 as getIdToken, a2 as getIdTokenResult, a6 as getMultiFactorResolver, n as inMemoryPersistence, a as indexedDBLocalPersistence, i as initializeAuth, d as initializeRecaptchaConfig, R as isSignInWithEmailLink, B as linkWithCredential, a7 as multiFactor, f as onAuthStateChanged, o as onIdTokenChanged, Z as parseActionCodeURL, p as prodErrorMap, C as reauthenticateWithCredential, a5 as reload, j as revokeAccessToken, W as sendEmailVerification, H as sendPasswordResetEmail, Q as sendSignInLinkToEmail, s as setPersistence, y as signInAnonymously, z as signInWithCredential, D as signInWithCustomToken, N as signInWithEmailAndPassword, U as signInWithEmailLink, h as signOut, a3 as unlink, g as updateCurrentUser, $ as updateEmail, a0 as updatePassword, _ as updateProfile, u as useDeviceLanguage, v as validatePassword, X as verifyBeforeUpdateEmail, L as verifyPasswordResetCode } from './register-ffa8f4d2.js';
1
+ import { r as registerAuth, i as initializeAuth, a as indexedDBLocalPersistence, c as connectAuthEmulator } from './register-49f5fb7d.js';
2
+ export { $ as ActionCodeURL, m as AuthCredential, A as AuthErrorCodes, E as EmailAuthCredential, q as EmailAuthProvider, F as FacebookAuthProvider, t as GithubAuthProvider, G as GoogleAuthProvider, O as OAuthCredential, w as OAuthProvider, P as PhoneAuthCredential, S as SAMLAuthProvider, T as TotpMultiFactorGenerator, b as TotpSecret, x as TwitterAuthProvider, J as applyActionCode, e as beforeAuthStateChanged, K as checkActionCode, I as confirmPasswordReset, c as connectAuthEmulator, M as createUserWithEmailAndPassword, l as debugErrorMap, k as deleteUser, Z as enrollPasskey, V as fetchSignInMethodsForEmail, a7 as getAdditionalUserInfo, a4 as getIdToken, a5 as getIdTokenResult, a9 as getMultiFactorResolver, n as inMemoryPersistence, a as indexedDBLocalPersistence, i as initializeAuth, d as initializeRecaptchaConfig, R as isSignInWithEmailLink, B as linkWithCredential, aa as multiFactor, f as onAuthStateChanged, o as onIdTokenChanged, a0 as parseActionCodeURL, p as prodErrorMap, C as reauthenticateWithCredential, a8 as reload, j as revokeAccessToken, W as sendEmailVerification, H as sendPasswordResetEmail, Q as sendSignInLinkToEmail, s as setPersistence, y as signInAnonymously, z as signInWithCredential, D as signInWithCustomToken, N as signInWithEmailAndPassword, U as signInWithEmailLink, Y as signInWithPasskey, h as signOut, _ as unenrollPasskey, a6 as unlink, g as updateCurrentUser, a2 as updateEmail, a3 as updatePassword, a1 as updateProfile, u as useDeviceLanguage, v as validatePassword, X as verifyBeforeUpdateEmail, L as verifyPasswordResetCode } from './register-49f5fb7d.js';
3
3
  import { _getProvider, getApp } from '@firebase/app';
4
4
  import { getDefaultEmulatorHost } from '@firebase/util';
5
5
  import 'tslib';
@@ -1,5 +1,5 @@
1
- import { a8 as STORAGE_AVAILABLE_KEY, a9 as _isIframe, aa as _isMobileBrowser, ab as _isIE10, ac as _isSafari, ad as _isIOS, ae as _assert, af as Delay, ag as _window, ah as isV2, ai as _createError, aj as _recaptchaV2ScriptUrl, ak as _loadJS, al as _generateCallbackName, am as _castAuth, an as _isHttpOrHttps, ao as _isWorker, ap as getRecaptchaParams, aq as _serverAppCurrentUserOperationNotSupportedError, z as signInWithCredential, ar as _assertLinkedStatus, B as linkWithCredential, C as reauthenticateWithCredential, as as startEnrollPhoneMfa, at as startSignInPhoneMfa, au as sendPhoneVerificationCode, av as _link$1, P as PhoneAuthCredential, aw as _getInstance, ax as _signInWithCredential, ay as _reauthenticate, m as AuthCredential, az as signInWithIdp, aA as _fail, aB as debugAssert, aC as _assertInstanceOf, aD as _generateEventId, aE as FederatedAuthProvider, aF as _persistenceKeyName, aG as _performApiRequest, aH as _getCurrentUrl, aI as _gapiScriptUrl, aJ as _emulatorUrl, aK as _isChromeIOS, aL as _isFirefox, aM as _isIOSStandalone, aN as BaseOAuthProvider, aO as _setWindowLocation, aP as MultiFactorAssertionImpl, aQ as finalizeEnrollPhoneMfa, aR as finalizeSignInPhoneMfa, r as registerAuth, i as initializeAuth, a as indexedDBLocalPersistence, e as beforeAuthStateChanged, o as onIdTokenChanged, c as connectAuthEmulator, aS as _setExternalJSProvider, aT as _isAndroid, aU as _isIOS7Or8 } from './register-ffa8f4d2.js';
2
- export { Y as ActionCodeURL, m as AuthCredential, A as AuthErrorCodes, aW as AuthImpl, E as EmailAuthCredential, q as EmailAuthProvider, F as FacebookAuthProvider, aY as FetchProvider, t as GithubAuthProvider, G as GoogleAuthProvider, O as OAuthCredential, w as OAuthProvider, P as PhoneAuthCredential, aZ as SAMLAuthCredential, S as SAMLAuthProvider, T as TotpMultiFactorGenerator, b as TotpSecret, x as TwitterAuthProvider, aV as UserImpl, ae as _assert, am as _castAuth, aA as _fail, aD as _generateEventId, aX as _getClientVersion, aw as _getInstance, aF as _persistenceKeyName, J as applyActionCode, e as beforeAuthStateChanged, K as checkActionCode, I as confirmPasswordReset, c as connectAuthEmulator, M as createUserWithEmailAndPassword, l as debugErrorMap, k as deleteUser, V as fetchSignInMethodsForEmail, a4 as getAdditionalUserInfo, a1 as getIdToken, a2 as getIdTokenResult, a6 as getMultiFactorResolver, n as inMemoryPersistence, a as indexedDBLocalPersistence, i as initializeAuth, d as initializeRecaptchaConfig, R as isSignInWithEmailLink, B as linkWithCredential, a7 as multiFactor, f as onAuthStateChanged, o as onIdTokenChanged, Z as parseActionCodeURL, p as prodErrorMap, C as reauthenticateWithCredential, a5 as reload, j as revokeAccessToken, W as sendEmailVerification, H as sendPasswordResetEmail, Q as sendSignInLinkToEmail, s as setPersistence, y as signInAnonymously, z as signInWithCredential, D as signInWithCustomToken, N as signInWithEmailAndPassword, U as signInWithEmailLink, h as signOut, a3 as unlink, g as updateCurrentUser, $ as updateEmail, a0 as updatePassword, _ as updateProfile, u as useDeviceLanguage, v as validatePassword, X as verifyBeforeUpdateEmail, L as verifyPasswordResetCode } from './register-ffa8f4d2.js';
1
+ import { ab as STORAGE_AVAILABLE_KEY, ac as _isIframe, ad as _isMobileBrowser, ae as _isIE10, af as _isSafari, ag as _isIOS, ah as _assert, ai as Delay, aj as _window, ak as isV2, al as _createError, am as _recaptchaV2ScriptUrl, an as _loadJS, ao as _generateCallbackName, ap as _castAuth, aq as _isHttpOrHttps, ar as _isWorker, as as getRecaptchaParams, at as _serverAppCurrentUserOperationNotSupportedError, z as signInWithCredential, au as _assertLinkedStatus, B as linkWithCredential, C as reauthenticateWithCredential, av as startEnrollPhoneMfa, aw as startSignInPhoneMfa, ax as sendPhoneVerificationCode, ay as _link$1, P as PhoneAuthCredential, az as _getInstance, aA as _signInWithCredential, aB as _reauthenticate, m as AuthCredential, aC as signInWithIdp, aD as _fail, aE as debugAssert, aF as _assertInstanceOf, aG as _generateEventId, aH as FederatedAuthProvider, aI as _persistenceKeyName, aJ as _performApiRequest, aK as _getCurrentUrl, aL as _gapiScriptUrl, aM as _emulatorUrl, aN as _isChromeIOS, aO as _isFirefox, aP as _isIOSStandalone, aQ as BaseOAuthProvider, aR as _setWindowLocation, aS as MultiFactorAssertionImpl, aT as finalizeEnrollPhoneMfa, aU as finalizeSignInPhoneMfa, r as registerAuth, i as initializeAuth, a as indexedDBLocalPersistence, e as beforeAuthStateChanged, o as onIdTokenChanged, c as connectAuthEmulator, aV as _setExternalJSProvider, aW as _isAndroid, aX as _isIOS7Or8 } from './register-49f5fb7d.js';
2
+ export { $ as ActionCodeURL, m as AuthCredential, A as AuthErrorCodes, aZ as AuthImpl, E as EmailAuthCredential, q as EmailAuthProvider, F as FacebookAuthProvider, a$ as FetchProvider, t as GithubAuthProvider, G as GoogleAuthProvider, O as OAuthCredential, w as OAuthProvider, P as PhoneAuthCredential, b0 as SAMLAuthCredential, S as SAMLAuthProvider, T as TotpMultiFactorGenerator, b as TotpSecret, x as TwitterAuthProvider, aY as UserImpl, ah as _assert, ap as _castAuth, aD as _fail, aG as _generateEventId, a_ as _getClientVersion, az as _getInstance, aI as _persistenceKeyName, J as applyActionCode, e as beforeAuthStateChanged, K as checkActionCode, I as confirmPasswordReset, c as connectAuthEmulator, M as createUserWithEmailAndPassword, l as debugErrorMap, k as deleteUser, Z as enrollPasskey, V as fetchSignInMethodsForEmail, a7 as getAdditionalUserInfo, a4 as getIdToken, a5 as getIdTokenResult, a9 as getMultiFactorResolver, n as inMemoryPersistence, a as indexedDBLocalPersistence, i as initializeAuth, d as initializeRecaptchaConfig, R as isSignInWithEmailLink, B as linkWithCredential, aa as multiFactor, f as onAuthStateChanged, o as onIdTokenChanged, a0 as parseActionCodeURL, p as prodErrorMap, C as reauthenticateWithCredential, a8 as reload, j as revokeAccessToken, W as sendEmailVerification, H as sendPasswordResetEmail, Q as sendSignInLinkToEmail, s as setPersistence, y as signInAnonymously, z as signInWithCredential, D as signInWithCustomToken, N as signInWithEmailAndPassword, U as signInWithEmailLink, Y as signInWithPasskey, h as signOut, _ as unenrollPasskey, a6 as unlink, g as updateCurrentUser, a2 as updateEmail, a3 as updatePassword, a1 as updateProfile, u as useDeviceLanguage, v as validatePassword, X as verifyBeforeUpdateEmail, L as verifyPasswordResetCode } from './register-49f5fb7d.js';
3
3
  import { getUA, querystring, getModularInstance, isEmpty, getExperimentalSetting, getDefaultEmulatorHost, querystringDecode } from '@firebase/util';
4
4
  import { _isFirebaseServerApp, SDK_VERSION, _getProvider, getApp } from '@firebase/app';
5
5
  import 'tslib';