base-auth.d.ts 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. /*! firebase-admin v12.1.1 */
  2. /*!
  3. * Copyright 2021 Google Inc.
  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 { FirebaseArrayIndexError } from '../app';
  18. import { DecodedIdToken, DecodedAuthBlockingToken } from './token-verifier';
  19. import { AuthProviderConfig, AuthProviderConfigFilter, ListProviderConfigResults, UpdateAuthProviderRequest, CreateRequest, UpdateRequest } from './auth-config';
  20. import { UserRecord } from './user-record';
  21. import { UserIdentifier } from './identifier';
  22. import { UserImportOptions, UserImportRecord, UserImportResult } from './user-import-builder';
  23. import { ActionCodeSettings } from './action-code-settings-builder';
  24. /** Represents the result of the {@link BaseAuth.getUsers} API. */
  25. export interface GetUsersResult {
  26. /**
  27. * Set of user records, corresponding to the set of users that were
  28. * requested. Only users that were found are listed here. The result set is
  29. * unordered.
  30. */
  31. users: UserRecord[];
  32. /** Set of identifiers that were requested, but not found. */
  33. notFound: UserIdentifier[];
  34. }
  35. /**
  36. * Interface representing the object returned from a
  37. * {@link BaseAuth.listUsers} operation. Contains the list
  38. * of users for the current batch and the next page token if available.
  39. */
  40. export interface ListUsersResult {
  41. /**
  42. * The list of {@link UserRecord} objects for the
  43. * current downloaded batch.
  44. */
  45. users: UserRecord[];
  46. /**
  47. * The next page token if available. This is needed for the next batch download.
  48. */
  49. pageToken?: string;
  50. }
  51. /**
  52. * Represents the result of the {@link BaseAuth.deleteUsers}.
  53. * API.
  54. */
  55. export interface DeleteUsersResult {
  56. /**
  57. * The number of user records that failed to be deleted (possibly zero).
  58. */
  59. failureCount: number;
  60. /**
  61. * The number of users that were deleted successfully (possibly zero).
  62. * Users that did not exist prior to calling `deleteUsers()` are
  63. * considered to be successfully deleted.
  64. */
  65. successCount: number;
  66. /**
  67. * A list of `FirebaseArrayIndexError` instances describing the errors that
  68. * were encountered during the deletion. Length of this list is equal to
  69. * the return value of {@link DeleteUsersResult.failureCount}.
  70. */
  71. errors: FirebaseArrayIndexError[];
  72. }
  73. /**
  74. * Interface representing the session cookie options needed for the
  75. * {@link BaseAuth.createSessionCookie} method.
  76. */
  77. export interface SessionCookieOptions {
  78. /**
  79. * The session cookie custom expiration in milliseconds. The minimum allowed is
  80. * 5 minutes and the maxium allowed is 2 weeks.
  81. */
  82. expiresIn: number;
  83. }
  84. /**
  85. * Common parent interface for both `Auth` and `TenantAwareAuth` APIs.
  86. */
  87. export declare abstract class BaseAuth {
  88. /**
  89. * Creates a new Firebase custom token (JWT) that can be sent back to a client
  90. * device to use to sign in with the client SDKs' `signInWithCustomToken()`
  91. * methods. (Tenant-aware instances will also embed the tenant ID in the
  92. * token.)
  93. *
  94. * See {@link https://firebase.google.com/docs/auth/admin/create-custom-tokens | Create Custom Tokens}
  95. * for code samples and detailed documentation.
  96. *
  97. * @param uid - The `uid` to use as the custom token's subject.
  98. * @param developerClaims - Optional additional claims to include
  99. * in the custom token's payload.
  100. *
  101. * @returns A promise fulfilled with a custom token for the
  102. * provided `uid` and payload.
  103. */
  104. createCustomToken(uid: string, developerClaims?: object): Promise<string>;
  105. /**
  106. * Verifies a Firebase ID token (JWT). If the token is valid, the promise is
  107. * fulfilled with the token's decoded claims; otherwise, the promise is
  108. * rejected.
  109. *
  110. * If `checkRevoked` is set to true, first verifies whether the corresponding
  111. * user is disabled. If yes, an `auth/user-disabled` error is thrown. If no,
  112. * verifies if the session corresponding to the ID token was revoked. If the
  113. * corresponding user's session was invalidated, an `auth/id-token-revoked`
  114. * error is thrown. If not specified the check is not applied.
  115. *
  116. * See {@link https://firebase.google.com/docs/auth/admin/verify-id-tokens | Verify ID Tokens}
  117. * for code samples and detailed documentation.
  118. *
  119. * @param idToken - The ID token to verify.
  120. * @param checkRevoked - Whether to check if the ID token was revoked.
  121. * This requires an extra request to the Firebase Auth backend to check
  122. * the `tokensValidAfterTime` time for the corresponding user.
  123. * When not specified, this additional check is not applied.
  124. *
  125. * @returns A promise fulfilled with the
  126. * token's decoded claims if the ID token is valid; otherwise, a rejected
  127. * promise.
  128. */
  129. verifyIdToken(idToken: string, checkRevoked?: boolean): Promise<DecodedIdToken>;
  130. /**
  131. * Gets the user data for the user corresponding to a given `uid`.
  132. *
  133. * See {@link https://firebase.google.com/docs/auth/admin/manage-users#retrieve_user_data | Retrieve user data}
  134. * for code samples and detailed documentation.
  135. *
  136. * @param uid - The `uid` corresponding to the user whose data to fetch.
  137. *
  138. * @returns A promise fulfilled with the user
  139. * data corresponding to the provided `uid`.
  140. */
  141. getUser(uid: string): Promise<UserRecord>;
  142. /**
  143. * Gets the user data for the user corresponding to a given email.
  144. *
  145. * See {@link https://firebase.google.com/docs/auth/admin/manage-users#retrieve_user_data | Retrieve user data}
  146. * for code samples and detailed documentation.
  147. *
  148. * @param email - The email corresponding to the user whose data to
  149. * fetch.
  150. *
  151. * @returns A promise fulfilled with the user
  152. * data corresponding to the provided email.
  153. */
  154. getUserByEmail(email: string): Promise<UserRecord>;
  155. /**
  156. * Gets the user data for the user corresponding to a given phone number. The
  157. * phone number has to conform to the E.164 specification.
  158. *
  159. * See {@link https://firebase.google.com/docs/auth/admin/manage-users#retrieve_user_data | Retrieve user data}
  160. * for code samples and detailed documentation.
  161. *
  162. * @param phoneNumber - The phone number corresponding to the user whose
  163. * data to fetch.
  164. *
  165. * @returns A promise fulfilled with the user
  166. * data corresponding to the provided phone number.
  167. */
  168. getUserByPhoneNumber(phoneNumber: string): Promise<UserRecord>;
  169. /**
  170. * Gets the user data for the user corresponding to a given provider id.
  171. *
  172. * See {@link https://firebase.google.com/docs/auth/admin/manage-users#retrieve_user_data | Retrieve user data}
  173. * for code samples and detailed documentation.
  174. *
  175. * @param providerId - The provider ID, for example, "google.com" for the
  176. * Google provider.
  177. * @param uid - The user identifier for the given provider.
  178. *
  179. * @returns A promise fulfilled with the user data corresponding to the
  180. * given provider id.
  181. */
  182. getUserByProviderUid(providerId: string, uid: string): Promise<UserRecord>;
  183. /**
  184. * Gets the user data corresponding to the specified identifiers.
  185. *
  186. * There are no ordering guarantees; in particular, the nth entry in the result list is not
  187. * guaranteed to correspond to the nth entry in the input parameters list.
  188. *
  189. * Only a maximum of 100 identifiers may be supplied. If more than 100 identifiers are supplied,
  190. * this method throws a FirebaseAuthError.
  191. *
  192. * @param identifiers - The identifiers used to indicate which user records should be returned.
  193. * Must not have more than 100 entries.
  194. * @returns A promise that resolves to the corresponding user records.
  195. * @throws FirebaseAuthError If any of the identifiers are invalid or if more than 100
  196. * identifiers are specified.
  197. */
  198. getUsers(identifiers: UserIdentifier[]): Promise<GetUsersResult>;
  199. /**
  200. * Retrieves a list of users (single batch only) with a size of `maxResults`
  201. * starting from the offset as specified by `pageToken`. This is used to
  202. * retrieve all the users of a specified project in batches.
  203. *
  204. * See {@link https://firebase.google.com/docs/auth/admin/manage-users#list_all_users | List all users}
  205. * for code samples and detailed documentation.
  206. *
  207. * @param maxResults - The page size, 1000 if undefined. This is also
  208. * the maximum allowed limit.
  209. * @param pageToken - The next page token. If not specified, returns
  210. * users starting without any offset.
  211. * @returns A promise that resolves with
  212. * the current batch of downloaded users and the next page token.
  213. */
  214. listUsers(maxResults?: number, pageToken?: string): Promise<ListUsersResult>;
  215. /**
  216. * Creates a new user.
  217. *
  218. * See {@link https://firebase.google.com/docs/auth/admin/manage-users#create_a_user | Create a user}
  219. * for code samples and detailed documentation.
  220. *
  221. * @param properties - The properties to set on the
  222. * new user record to be created.
  223. *
  224. * @returns A promise fulfilled with the user
  225. * data corresponding to the newly created user.
  226. */
  227. createUser(properties: CreateRequest): Promise<UserRecord>;
  228. /**
  229. * Deletes an existing user.
  230. *
  231. * See {@link https://firebase.google.com/docs/auth/admin/manage-users#delete_a_user | Delete a user}
  232. * for code samples and detailed documentation.
  233. *
  234. * @param uid - The `uid` corresponding to the user to delete.
  235. *
  236. * @returns An empty promise fulfilled once the user has been
  237. * deleted.
  238. */
  239. deleteUser(uid: string): Promise<void>;
  240. /**
  241. * Deletes the users specified by the given uids.
  242. *
  243. * Deleting a non-existing user won't generate an error (i.e. this method
  244. * is idempotent.) Non-existing users are considered to be successfully
  245. * deleted, and are therefore counted in the
  246. * `DeleteUsersResult.successCount` value.
  247. *
  248. * Only a maximum of 1000 identifiers may be supplied. If more than 1000
  249. * identifiers are supplied, this method throws a FirebaseAuthError.
  250. *
  251. * This API is currently rate limited at the server to 1 QPS. If you exceed
  252. * this, you may get a quota exceeded error. Therefore, if you want to
  253. * delete more than 1000 users, you may need to add a delay to ensure you
  254. * don't go over this limit.
  255. *
  256. * @param uids - The `uids` corresponding to the users to delete.
  257. *
  258. * @returns A Promise that resolves to the total number of successful/failed
  259. * deletions, as well as the array of errors that corresponds to the
  260. * failed deletions.
  261. */
  262. deleteUsers(uids: string[]): Promise<DeleteUsersResult>;
  263. /**
  264. * Updates an existing user.
  265. *
  266. * See {@link https://firebase.google.com/docs/auth/admin/manage-users#update_a_user | Update a user}
  267. * for code samples and detailed documentation.
  268. *
  269. * @param uid - The `uid` corresponding to the user to update.
  270. * @param properties - The properties to update on
  271. * the provided user.
  272. *
  273. * @returns A promise fulfilled with the
  274. * updated user data.
  275. */
  276. updateUser(uid: string, properties: UpdateRequest): Promise<UserRecord>;
  277. /**
  278. * Sets additional developer claims on an existing user identified by the
  279. * provided `uid`, typically used to define user roles and levels of
  280. * access. These claims should propagate to all devices where the user is
  281. * already signed in (after token expiration or when token refresh is forced)
  282. * and the next time the user signs in. If a reserved OIDC claim name
  283. * is used (sub, iat, iss, etc), an error is thrown. They are set on the
  284. * authenticated user's ID token JWT.
  285. *
  286. * See {@link https://firebase.google.com/docs/auth/admin/custom-claims |
  287. * Defining user roles and access levels}
  288. * for code samples and detailed documentation.
  289. *
  290. * @param uid - The `uid` of the user to edit.
  291. * @param customUserClaims - The developer claims to set. If null is
  292. * passed, existing custom claims are deleted. Passing a custom claims payload
  293. * larger than 1000 bytes will throw an error. Custom claims are added to the
  294. * user's ID token which is transmitted on every authenticated request.
  295. * For profile non-access related user attributes, use database or other
  296. * separate storage systems.
  297. * @returns A promise that resolves when the operation completes
  298. * successfully.
  299. */
  300. setCustomUserClaims(uid: string, customUserClaims: object | null): Promise<void>;
  301. /**
  302. * Revokes all refresh tokens for an existing user.
  303. *
  304. * This API will update the user's {@link UserRecord.tokensValidAfterTime} to
  305. * the current UTC. It is important that the server on which this is called has
  306. * its clock set correctly and synchronized.
  307. *
  308. * While this will revoke all sessions for a specified user and disable any
  309. * new ID tokens for existing sessions from getting minted, existing ID tokens
  310. * may remain active until their natural expiration (one hour). To verify that
  311. * ID tokens are revoked, use {@link BaseAuth.verifyIdToken}
  312. * where `checkRevoked` is set to true.
  313. *
  314. * @param uid - The `uid` corresponding to the user whose refresh tokens
  315. * are to be revoked.
  316. *
  317. * @returns An empty promise fulfilled once the user's refresh
  318. * tokens have been revoked.
  319. */
  320. revokeRefreshTokens(uid: string): Promise<void>;
  321. /**
  322. * Imports the provided list of users into Firebase Auth.
  323. * A maximum of 1000 users are allowed to be imported one at a time.
  324. * When importing users with passwords,
  325. * {@link UserImportOptions} are required to be
  326. * specified.
  327. * This operation is optimized for bulk imports and will ignore checks on `uid`,
  328. * `email` and other identifier uniqueness which could result in duplications.
  329. *
  330. * @param users - The list of user records to import to Firebase Auth.
  331. * @param options - The user import options, required when the users provided include
  332. * password credentials.
  333. * @returns A promise that resolves when
  334. * the operation completes with the result of the import. This includes the
  335. * number of successful imports, the number of failed imports and their
  336. * corresponding errors.
  337. */
  338. importUsers(users: UserImportRecord[], options?: UserImportOptions): Promise<UserImportResult>;
  339. /**
  340. * Creates a new Firebase session cookie with the specified options. The created
  341. * JWT string can be set as a server-side session cookie with a custom cookie
  342. * policy, and be used for session management. The session cookie JWT will have
  343. * the same payload claims as the provided ID token.
  344. *
  345. * See {@link https://firebase.google.com/docs/auth/admin/manage-cookies | Manage Session Cookies}
  346. * for code samples and detailed documentation.
  347. *
  348. * @param idToken - The Firebase ID token to exchange for a session
  349. * cookie.
  350. * @param sessionCookieOptions - The session
  351. * cookie options which includes custom session duration.
  352. *
  353. * @returns A promise that resolves on success with the
  354. * created session cookie.
  355. */
  356. createSessionCookie(idToken: string, sessionCookieOptions: SessionCookieOptions): Promise<string>;
  357. /**
  358. * Verifies a Firebase session cookie. Returns a Promise with the cookie claims.
  359. * Rejects the promise if the cookie could not be verified.
  360. *
  361. * If `checkRevoked` is set to true, first verifies whether the corresponding
  362. * user is disabled: If yes, an `auth/user-disabled` error is thrown. If no,
  363. * verifies if the session corresponding to the session cookie was revoked.
  364. * If the corresponding user's session was invalidated, an
  365. * `auth/session-cookie-revoked` error is thrown. If not specified the check
  366. * is not performed.
  367. *
  368. * See {@link https://firebase.google.com/docs/auth/admin/manage-cookies#verify_session_cookie_and_check_permissions |
  369. * Verify Session Cookies}
  370. * for code samples and detailed documentation
  371. *
  372. * @param sessionCookie - The session cookie to verify.
  373. * @param checkForRevocation - Whether to check if the session cookie was
  374. * revoked. This requires an extra request to the Firebase Auth backend to
  375. * check the `tokensValidAfterTime` time for the corresponding user.
  376. * When not specified, this additional check is not performed.
  377. *
  378. * @returns A promise fulfilled with the
  379. * session cookie's decoded claims if the session cookie is valid; otherwise,
  380. * a rejected promise.
  381. */
  382. verifySessionCookie(sessionCookie: string, checkRevoked?: boolean): Promise<DecodedIdToken>;
  383. /**
  384. * Generates the out of band email action link to reset a user's password.
  385. * The link is generated for the user with the specified email address. The
  386. * optional {@link ActionCodeSettings} object
  387. * defines whether the link is to be handled by a mobile app or browser and the
  388. * additional state information to be passed in the deep link, etc.
  389. *
  390. * @example
  391. * ```javascript
  392. * var actionCodeSettings = {
  393. * url: 'https://www.example.com/?email=user@example.com',
  394. * iOS: {
  395. * bundleId: 'com.example.ios'
  396. * },
  397. * android: {
  398. * packageName: 'com.example.android',
  399. * installApp: true,
  400. * minimumVersion: '12'
  401. * },
  402. * handleCodeInApp: true,
  403. * dynamicLinkDomain: 'custom.page.link'
  404. * };
  405. * admin.auth()
  406. * .generatePasswordResetLink('user@example.com', actionCodeSettings)
  407. * .then(function(link) {
  408. * // The link was successfully generated.
  409. * })
  410. * .catch(function(error) {
  411. * // Some error occurred, you can inspect the code: error.code
  412. * });
  413. * ```
  414. *
  415. * @param email - The email address of the user whose password is to be
  416. * reset.
  417. * @param actionCodeSettings - The action
  418. * code settings. If specified, the state/continue URL is set as the
  419. * "continueUrl" parameter in the password reset link. The default password
  420. * reset landing page will use this to display a link to go back to the app
  421. * if it is installed.
  422. * If the actionCodeSettings is not specified, no URL is appended to the
  423. * action URL.
  424. * The state URL provided must belong to a domain that is whitelisted by the
  425. * developer in the console. Otherwise an error is thrown.
  426. * Mobile app redirects are only applicable if the developer configures
  427. * and accepts the Firebase Dynamic Links terms of service.
  428. * The Android package name and iOS bundle ID are respected only if they
  429. * are configured in the same Firebase Auth project.
  430. * @returns A promise that resolves with the generated link.
  431. */
  432. generatePasswordResetLink(email: string, actionCodeSettings?: ActionCodeSettings): Promise<string>;
  433. /**
  434. * Generates the out of band email action link to verify the user's ownership
  435. * of the specified email. The {@link ActionCodeSettings} object provided
  436. * as an argument to this method defines whether the link is to be handled by a
  437. * mobile app or browser along with additional state information to be passed in
  438. * the deep link, etc.
  439. *
  440. * @example
  441. * ```javascript
  442. * var actionCodeSettings = {
  443. * url: 'https://www.example.com/cart?email=user@example.com&cartId=123',
  444. * iOS: {
  445. * bundleId: 'com.example.ios'
  446. * },
  447. * android: {
  448. * packageName: 'com.example.android',
  449. * installApp: true,
  450. * minimumVersion: '12'
  451. * },
  452. * handleCodeInApp: true,
  453. * dynamicLinkDomain: 'custom.page.link'
  454. * };
  455. * admin.auth()
  456. * .generateEmailVerificationLink('user@example.com', actionCodeSettings)
  457. * .then(function(link) {
  458. * // The link was successfully generated.
  459. * })
  460. * .catch(function(error) {
  461. * // Some error occurred, you can inspect the code: error.code
  462. * });
  463. * ```
  464. *
  465. * @param email - The email account to verify.
  466. * @param actionCodeSettings - The action
  467. * code settings. If specified, the state/continue URL is set as the
  468. * "continueUrl" parameter in the email verification link. The default email
  469. * verification landing page will use this to display a link to go back to
  470. * the app if it is installed.
  471. * If the actionCodeSettings is not specified, no URL is appended to the
  472. * action URL.
  473. * The state URL provided must belong to a domain that is whitelisted by the
  474. * developer in the console. Otherwise an error is thrown.
  475. * Mobile app redirects are only applicable if the developer configures
  476. * and accepts the Firebase Dynamic Links terms of service.
  477. * The Android package name and iOS bundle ID are respected only if they
  478. * are configured in the same Firebase Auth project.
  479. * @returns A promise that resolves with the generated link.
  480. */
  481. generateEmailVerificationLink(email: string, actionCodeSettings?: ActionCodeSettings): Promise<string>;
  482. /**
  483. * Generates an out-of-band email action link to verify the user's ownership
  484. * of the specified email. The {@link ActionCodeSettings} object provided
  485. * as an argument to this method defines whether the link is to be handled by a
  486. * mobile app or browser along with additional state information to be passed in
  487. * the deep link, etc.
  488. *
  489. * @param email - The current email account.
  490. * @param newEmail - The email address the account is being updated to.
  491. * @param actionCodeSettings - The action
  492. * code settings. If specified, the state/continue URL is set as the
  493. * "continueUrl" parameter in the email verification link. The default email
  494. * verification landing page will use this to display a link to go back to
  495. * the app if it is installed.
  496. * If the actionCodeSettings is not specified, no URL is appended to the
  497. * action URL.
  498. * The state URL provided must belong to a domain that is authorized
  499. * in the console, or an error will be thrown.
  500. * Mobile app redirects are only applicable if the developer configures
  501. * and accepts the Firebase Dynamic Links terms of service.
  502. * The Android package name and iOS bundle ID are respected only if they
  503. * are configured in the same Firebase Auth project.
  504. * @returns A promise that resolves with the generated link.
  505. */
  506. generateVerifyAndChangeEmailLink(email: string, newEmail: string, actionCodeSettings?: ActionCodeSettings): Promise<string>;
  507. /**
  508. * Generates the out of band email action link to verify the user's ownership
  509. * of the specified email. The {@link ActionCodeSettings} object provided
  510. * as an argument to this method defines whether the link is to be handled by a
  511. * mobile app or browser along with additional state information to be passed in
  512. * the deep link, etc.
  513. *
  514. * @example
  515. * ```javascript
  516. * var actionCodeSettings = {
  517. * url: 'https://www.example.com/cart?email=user@example.com&cartId=123',
  518. * iOS: {
  519. * bundleId: 'com.example.ios'
  520. * },
  521. * android: {
  522. * packageName: 'com.example.android',
  523. * installApp: true,
  524. * minimumVersion: '12'
  525. * },
  526. * handleCodeInApp: true,
  527. * dynamicLinkDomain: 'custom.page.link'
  528. * };
  529. * admin.auth()
  530. * .generateEmailVerificationLink('user@example.com', actionCodeSettings)
  531. * .then(function(link) {
  532. * // The link was successfully generated.
  533. * })
  534. * .catch(function(error) {
  535. * // Some error occurred, you can inspect the code: error.code
  536. * });
  537. * ```
  538. *
  539. * @param email - The email account to verify.
  540. * @param actionCodeSettings - The action
  541. * code settings. If specified, the state/continue URL is set as the
  542. * "continueUrl" parameter in the email verification link. The default email
  543. * verification landing page will use this to display a link to go back to
  544. * the app if it is installed.
  545. * If the actionCodeSettings is not specified, no URL is appended to the
  546. * action URL.
  547. * The state URL provided must belong to a domain that is whitelisted by the
  548. * developer in the console. Otherwise an error is thrown.
  549. * Mobile app redirects are only applicable if the developer configures
  550. * and accepts the Firebase Dynamic Links terms of service.
  551. * The Android package name and iOS bundle ID are respected only if they
  552. * are configured in the same Firebase Auth project.
  553. * @returns A promise that resolves with the generated link.
  554. */
  555. generateSignInWithEmailLink(email: string, actionCodeSettings: ActionCodeSettings): Promise<string>;
  556. /**
  557. * Returns the list of existing provider configurations matching the filter
  558. * provided. At most, 100 provider configs can be listed at a time.
  559. *
  560. * SAML and OIDC provider support requires Google Cloud's Identity Platform
  561. * (GCIP). To learn more about GCIP, including pricing and features,
  562. * see the {@link https://cloud.google.com/identity-platform | GCIP documentation}.
  563. *
  564. * @param options - The provider config filter to apply.
  565. * @returns A promise that resolves with the list of provider configs meeting the
  566. * filter requirements.
  567. */
  568. listProviderConfigs(options: AuthProviderConfigFilter): Promise<ListProviderConfigResults>;
  569. /**
  570. * Looks up an Auth provider configuration by the provided ID.
  571. * Returns a promise that resolves with the provider configuration
  572. * corresponding to the provider ID specified. If the specified ID does not
  573. * exist, an `auth/configuration-not-found` error is thrown.
  574. *
  575. * SAML and OIDC provider support requires Google Cloud's Identity Platform
  576. * (GCIP). To learn more about GCIP, including pricing and features,
  577. * see the {@link https://cloud.google.com/identity-platform | GCIP documentation}.
  578. *
  579. * @param providerId - The provider ID corresponding to the provider
  580. * config to return.
  581. * @returns A promise that resolves
  582. * with the configuration corresponding to the provided ID.
  583. */
  584. getProviderConfig(providerId: string): Promise<AuthProviderConfig>;
  585. /**
  586. * Deletes the provider configuration corresponding to the provider ID passed.
  587. * If the specified ID does not exist, an `auth/configuration-not-found` error
  588. * is thrown.
  589. *
  590. * SAML and OIDC provider support requires Google Cloud's Identity Platform
  591. * (GCIP). To learn more about GCIP, including pricing and features,
  592. * see the {@link https://cloud.google.com/identity-platform | GCIP documentation}.
  593. *
  594. * @param providerId - The provider ID corresponding to the provider
  595. * config to delete.
  596. * @returns A promise that resolves on completion.
  597. */
  598. deleteProviderConfig(providerId: string): Promise<void>;
  599. /**
  600. * Returns a promise that resolves with the updated `AuthProviderConfig`
  601. * corresponding to the provider ID specified.
  602. * If the specified ID does not exist, an `auth/configuration-not-found` error
  603. * is thrown.
  604. *
  605. * SAML and OIDC provider support requires Google Cloud's Identity Platform
  606. * (GCIP). To learn more about GCIP, including pricing and features,
  607. * see the {@link https://cloud.google.com/identity-platform | GCIP documentation}.
  608. *
  609. * @param providerId - The provider ID corresponding to the provider
  610. * config to update.
  611. * @param updatedConfig - The updated configuration.
  612. * @returns A promise that resolves with the updated provider configuration.
  613. */
  614. updateProviderConfig(providerId: string, updatedConfig: UpdateAuthProviderRequest): Promise<AuthProviderConfig>;
  615. /**
  616. * Returns a promise that resolves with the newly created `AuthProviderConfig`
  617. * when the new provider configuration is created.
  618. *
  619. * SAML and OIDC provider support requires Google Cloud's Identity Platform
  620. * (GCIP). To learn more about GCIP, including pricing and features,
  621. * see the {@link https://cloud.google.com/identity-platform | GCIP documentation}.
  622. *
  623. * @param config - The provider configuration to create.
  624. * @returns A promise that resolves with the created provider configuration.
  625. */
  626. createProviderConfig(config: AuthProviderConfig): Promise<AuthProviderConfig>;
  627. /** @alpha */
  628. _verifyAuthBlockingToken(token: string, audience?: string): Promise<DecodedAuthBlockingToken>;
  629. /**
  630. * Verifies the decoded Firebase issued JWT is not revoked or disabled. Returns a promise that
  631. * resolves with the decoded claims on success. Rejects the promise with revocation error if revoked
  632. * or user disabled.
  633. *
  634. * @param decodedIdToken - The JWT's decoded claims.
  635. * @param revocationErrorInfo - The revocation error info to throw on revocation
  636. * detection.
  637. * @returns A promise that will be fulfilled after a successful verification.
  638. */
  639. private verifyDecodedJWTNotRevokedOrDisabled;
  640. }