[FR] auth: Allow expiry to be specified in .createCustomToken
See original GitHub issueIs your feature request related to a problem? Please describe.
It would be good if you could specify the duration of time you would like the login token to be valid for. For our use at least, the result of .createCustomToken
is mostly used immediately after being provided to the client, so we’d like to have a very short expiry time.
Describe the solution you’d like
Update .createCustomToken
or a new method .createCustomTokenWithOptions
that takes an expiry.
Describe alternatives you’ve considered
Using the details from create custom tokens using a third-party JWT library, but this seems a bit redundant when the SDK is so close to providing what is needed.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Firebase auth set custom expiration time for custom token
The google backend currently only accepts expiration in seconds up to 1 hour. Anything more than that will give you an auth/invalid-custom-token ...
Read more >Create Custom Tokens | Firebase Authentication - Google
Custom tokens are signed JWTs where the private key used for signing belongs to a Google service account. There are several ways to...
Read more >Firebase Auth: Sign In Link with Custom Expiration - Medium
Create our own custom token for long lasting sign-in; Expose an endpoint that convert our custom token to a Firebase one; Use such...
Read more >Authentication — Firebase Admin SDK for PHP Documentation
These tokens expire after one hour. $uid = 'some-uid'; $customToken = $auth->createCustomToken($uid);. You can also optionally specify additional claims to ...
Read more >Minting Custom Tokens with the Admin SDK for Node.js
Learn how to initialize the Admin SDK for Node.js and create custom JSON ... In this Firecast, Jen Person shows you how to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah, the internal service we use only allows 1 hour max and they are unlikely to change it. I would also agree with that from a security perspective.
FIY: @prameshj @renkelvin