firebase / firebase/firebase-js-sdk
FR: Single Sign On - firebase.auth().signInWithToken(token)
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Description
* Operating System version: MacOS
* Browser version: Chrome
* Firebase SDK version: 7.2.0
* Firebase Product: auth
If I have 2 apps that the same user can use (apps share same firebase project) then that user must log in to both apps to be authenticated in both.
If I mint my own custom token I can authenticate the same user in both apps (with only one login) using:
`firebase.auth().signInWithCustomToken(token)`
...but to do so requires jumping through some hoops.
However, firebase already provides a valid JWT (token) once a user logs in so would it be possible to provide this token from app A to app B to authenticate the same user on app B automatically. Something like:
`firebase.auth().signInWithToken(token)`
I've searched up and down the internet and there doesn't seem to be a clean solution for something like this at the moment, unless I've missed something.
Contributor guide
Research direction
Start by reviewing the Auth SDK's existing signInWithCustomToken(token) entry point and the JWT returned after login. Compare those with the proposed signInWithToken(token) API and determine the supported authentication and security requirements. Done means the issue's cross-app sign-in request has a settled design and an implementation path, but no file or test is named here.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- firebase, javascript, typescript
- Domain
- authentication
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100