Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit cfa16af

Browse files
committed
[docs] - Add example for custom token sign in for webApi
1 parent cd404b8 commit cfa16af

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/AUTHENTICATION.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,9 @@ Note that changing a password may fail if your login for this `email` was too lo
461461
### Custom login
462462
Use this login type to authenticate against firebase using a token generated by your own backend server. See these [instructions on how to generate the authentication token](https://firebase.google.com/docs/auth/server).
463463

464+
<details>
465+
<summary>Native API</summary>
466+
464467
```js
465468
var token = "myBackendToken";
466469

@@ -478,6 +481,17 @@ Use this login type to authenticate against firebase using a token generated by
478481
}
479482
);
480483
```
484+
</details>
485+
486+
<details>
487+
<summary>Web API</summary>
488+
489+
```typescript
490+
firebaseWebApi.auth().signInWithCustomToken(token)
491+
.then(result => console.log(JSON.stringify(result)))
492+
.catch(error => console.log(JSON.stringify(error)));
493+
```
494+
</details>
481495

482496
### Facebook login
483497

0 commit comments

Comments
 (0)