Skip to content

Commit 263f07b

Browse files
committed
running yarn docgen:all
1 parent ad3442c commit 263f07b

File tree

6 files changed

+136
-2
lines changed

6 files changed

+136
-2
lines changed

docs-devsite/_toc.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,14 @@ toc:
368368
path: /docs/reference/js/auth.recaptchaparameters.md
369369
- title: RecaptchaVerifier
370370
path: /docs/reference/js/auth.recaptchaverifier.md
371+
- title: RefreshIdpTokenResult
372+
path: /docs/reference/js/auth.refreshidptokenresult.md
371373
- title: SAMLAuthProvider
372374
path: /docs/reference/js/auth.samlauthprovider.md
373375
- title: TenantConfig
374376
path: /docs/reference/js/auth.tenantconfig.md
377+
- title: TokenRefreshHandler
378+
path: /docs/reference/js/auth.tokenrefreshhandler.md
375379
- title: TotpMultiFactorAssertion
376380
path: /docs/reference/js/auth.totpmultifactorassertion.md
377381
- title: TotpMultiFactorGenerator

docs-devsite/auth.auth.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export interface Auth
4444
| [onAuthStateChanged(nextOrObserver, error, completed)](./auth.auth.md#authonauthstatechanged) | Adds an observer for changes to the user's sign-in state. |
4545
| [onIdTokenChanged(nextOrObserver, error, completed)](./auth.auth.md#authonidtokenchanged) | Adds an observer for changes to the signed-in user's ID token. |
4646
| [setPersistence(persistence)](./auth.auth.md#authsetpersistence) | Changes the type of persistence on the <code>Auth</code> instance. |
47+
| [setTokenRefreshHandler(tokenRefreshHandler)](./auth.auth.md#authsettokenrefreshhandler) | Registers a handler for refreshing third-party identity provider (IDP) tokens.<!-- -->When the Firebase access token is expired, the SDK will automatically invoke the provided handler's <code>refreshIdpToken()</code> method to obtain a new IDP token. This new token will then be exchanged for a fresh Firebase token, streamlining the authentication process. |
4748
| [signOut()](./auth.auth.md#authsignout) | Signs out the current user. This does not automatically revoke the user's ID token. |
4849
| [updateCurrentUser(user)](./auth.auth.md#authupdatecurrentuser) | Asynchronously sets the provided user as [Auth.currentUser](./auth.auth.md#authcurrentuser) on the [Auth](./auth.auth.md#auth_interface) instance. |
4950
| [useDeviceLanguage()](./auth.auth.md#authusedevicelanguage) | Sets the current language to the default device/browser preference. |
@@ -285,6 +286,44 @@ auth.setPersistence(browserSessionPersistence);
285286

286287
```
287288

289+
## Auth.setTokenRefreshHandler()
290+
291+
Registers a handler for refreshing third-party identity provider (IDP) tokens.
292+
293+
When the Firebase access token is expired, the SDK will automatically invoke the provided handler's `refreshIdpToken()` method to obtain a new IDP token. This new token will then be exchanged for a fresh Firebase token, streamlining the authentication process.
294+
295+
<b>Signature:</b>
296+
297+
```typescript
298+
setTokenRefreshHandler(tokenRefreshHandler: TokenRefreshHandler): void;
299+
```
300+
301+
#### Parameters
302+
303+
| Parameter | Type | Description |
304+
| --- | --- | --- |
305+
| tokenRefreshHandler | [TokenRefreshHandler](./auth.tokenrefreshhandler.md#tokenrefreshhandler_interface) | An object that implements the <code>TokenRefreshHandler</code> interface, providing the logic to refresh the IDP token. |
306+
307+
<b>Returns:</b>
308+
309+
void
310+
311+
### Example
312+
313+
314+
```javascript
315+
class TokenRefreshHandlerImpl {
316+
refreshIdpToken() {
317+
// Logic to fetch a new token from your custom IDP.
318+
// Returns a Promise that resolves with a RefreshIdpTokenResult.
319+
}
320+
}
321+
322+
const tokenRefreshHandler = new TokenRefreshHandlerImpl();
323+
auth.setTokenRefreshHandler(tokenRefreshHandler);
324+
325+
```
326+
288327
## Auth.signOut()
289328

290329
Signs out the current user. This does not automatically revoke the user's ID token.

docs-devsite/auth.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ Firebase Authentication
139139
| [PopupRedirectResolver](./auth.popupredirectresolver.md#popupredirectresolver_interface) | A resolver used for handling DOM specific operations like [signInWithPopup()](./auth.md#signinwithpopup_770f816) or [signInWithRedirect()](./auth.md#signinwithredirect_770f816)<!-- -->. |
140140
| [ReactNativeAsyncStorage](./auth.reactnativeasyncstorage.md#reactnativeasyncstorage_interface) | Interface for a supplied <code>AsyncStorage</code>. |
141141
| [RecaptchaParameters](./auth.recaptchaparameters.md#recaptchaparameters_interface) | Interface representing reCAPTCHA parameters.<!-- -->See the [reCAPTCHA docs](https://developers.google.com/recaptcha/docs/display#render_param) for the list of accepted parameters. All parameters are accepted except for <code>sitekey</code>: Firebase Auth provisions a reCAPTCHA for each project and will configure the site key upon rendering.<!-- -->For an invisible reCAPTCHA, set the <code>size</code> key to <code>invisible</code>. |
142+
| [RefreshIdpTokenResult](./auth.refreshidptokenresult.md#refreshidptokenresult_interface) | The result of a third-party IDP token refresh operation.<!-- -->This object contains the new IDP token and the Idp Config ID of the provider that issued it. |
142143
| [TenantConfig](./auth.tenantconfig.md#tenantconfig_interface) | The tenant config that can be used to initialize a Regional [Auth](./auth.auth.md#auth_interface) instance. |
144+
| [TokenRefreshHandler](./auth.tokenrefreshhandler.md#tokenrefreshhandler_interface) | An interface for handling the refresh of Firebase tokens. |
143145
| [TotpMultiFactorAssertion](./auth.totpmultifactorassertion.md#totpmultifactorassertion_interface) | The class for asserting ownership of a TOTP second factor. Provided by [TotpMultiFactorGenerator.assertionForEnrollment()](./auth.totpmultifactorgenerator.md#totpmultifactorgeneratorassertionforenrollment) and [TotpMultiFactorGenerator.assertionForSignIn()](./auth.totpmultifactorgenerator.md#totpmultifactorgeneratorassertionforsignin)<!-- -->. |
144146
| [TotpMultiFactorInfo](./auth.totpmultifactorinfo.md#totpmultifactorinfo_interface) | The subclass of the [MultiFactorInfo](./auth.multifactorinfo.md#multifactorinfo_interface) interface for TOTP second factors. The <code>factorId</code> of this second factor is [FactorId](./auth.md#factorid)<!-- -->.TOTP. |
145147
| [User](./auth.user.md#user_interface) | A user account. |
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Project: /docs/reference/js/_project.yaml
2+
Book: /docs/reference/_book.yaml
3+
page_type: reference
4+
5+
{% comment %}
6+
DO NOT EDIT THIS FILE!
7+
This is generated by the JS SDK team, and any local changes will be
8+
overwritten. Changes should be made in the source code at
9+
https://github.com/firebase/firebase-js-sdk
10+
{% endcomment %}
11+
12+
# RefreshIdpTokenResult interface
13+
The result of a third-party IDP token refresh operation.
14+
15+
This object contains the new IDP token and the Idp Config ID of the provider that issued it.
16+
17+
<b>Signature:</b>
18+
19+
```typescript
20+
export interface RefreshIdpTokenResult
21+
```
22+
23+
## Properties
24+
25+
| Property | Type | Description |
26+
| --- | --- | --- |
27+
| [idpConfigId](./auth.refreshidptokenresult.md#refreshidptokenresultidpconfigid) | string | The configuration ID of the third-party identity provider. |
28+
| [idToken](./auth.refreshidptokenresult.md#refreshidptokenresultidtoken) | string | The new Id Token from the 3rd party Identity Provider. |
29+
30+
## RefreshIdpTokenResult.idpConfigId
31+
32+
The configuration ID of the third-party identity provider.
33+
34+
<b>Signature:</b>
35+
36+
```typescript
37+
idpConfigId: string;
38+
```
39+
40+
## RefreshIdpTokenResult.idToken
41+
42+
The new Id Token from the 3rd party Identity Provider.
43+
44+
<b>Signature:</b>
45+
46+
```typescript
47+
idToken: string;
48+
```
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Project: /docs/reference/js/_project.yaml
2+
Book: /docs/reference/_book.yaml
3+
page_type: reference
4+
5+
{% comment %}
6+
DO NOT EDIT THIS FILE!
7+
This is generated by the JS SDK team, and any local changes will be
8+
overwritten. Changes should be made in the source code at
9+
https://github.com/firebase/firebase-js-sdk
10+
{% endcomment %}
11+
12+
# TokenRefreshHandler interface
13+
An interface for handling the refresh of Firebase tokens.
14+
15+
<b>Signature:</b>
16+
17+
```typescript
18+
export interface TokenRefreshHandler
19+
```
20+
21+
## Methods
22+
23+
| Method | Description |
24+
| --- | --- |
25+
| [refreshIdpToken()](./auth.tokenrefreshhandler.md#tokenrefreshhandlerrefreshidptoken) | Refreshes the third-party IDP token.<!-- -->This method should contain the logic to obtain a new, valid IDP token from your identity provider. |
26+
27+
## TokenRefreshHandler.refreshIdpToken()
28+
29+
Refreshes the third-party IDP token.
30+
31+
This method should contain the logic to obtain a new, valid IDP token from your identity provider.
32+
33+
<b>Signature:</b>
34+
35+
```typescript
36+
refreshIdpToken(): Promise<RefreshIdpTokenResult>;
37+
```
38+
<b>Returns:</b>
39+
40+
Promise&lt;[RefreshIdpTokenResult](./auth.refreshidptokenresult.md#refreshidptokenresult_interface)<!-- -->&gt;
41+
42+
A promise that resolves with a `RefreshIdpTokenResult` object containing the new IDP token and its corresponding Idp Config ID.
43+

packages/auth/src/model/public_types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ export interface RefreshIdpTokenResult {
156156
idToken: string;
157157
}
158158

159-
160-
161159
/**
162160
* Interface for an `Auth` error.
163161
*

0 commit comments

Comments
 (0)