question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

createSessionCookie uses number when it should use a string

See original GitHub issue

Originally reported here https://github.com/firebase/firebase-tools/issues/2770#issuecomment-723364018


@samtstern I think this is a real issue, actually! I’m encountering it even though I’m executing createSessionCookie inside the function emulator. So I dug in, and I believe the validation schema is wrong. The auth emulator validation schema specifies validationDuration as a string, but firebase-admin-node constructs it as a number.

I note that the OpenAPI schema for createSessionCookie specifies the parameter as “string (int64 format)”. If that means it’s meant to be a string-encoded int64, then this is really a firebase-admin-node bug, although clearly the production auth server is accepting numbers for this parameter.

_Originally posted by @andymatuschak in https://github.com/firebase/firebase-tools/issues/2770#issuecomment-723364018_

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
yuchenshicommented, Feb 11, 2021

FWIW: As of Firebase CLI v9.3.0, creating session cookie is now supported and we’ve also added coercion from number to string similar to production behavior (hat tip to @andymatuschak). Note that you need Node.js Admin SDK v9.5.0 to verify these cookies properly. (in reply to @aaronosher @muru)

3reactions
DevJoghurtcommented, Nov 19, 2020

Are there any news about this? Unfortunately, I haven’t found a workaround yet and the topic restricts local development considerably.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage Session Cookies | Firebase Authentication
Verify session cookies using a third-party JWT library ; sub, Subject, Must be a non-empty string and must be the uid of the...
Read more >
NodeJS + Google Login + Firebase Functions results in ...
This error occurs after successfully creating a session using the sample /sessionLogin code found here on firebase's site: const auth = admin.
Read more >
Method: projects.createSessionCookie | Identity Platform ...
Creates a session cookie for the given Identity Platform ID token. The session cookie is used by the client to preserve the user's...
Read more >
Understanding Cookies and Implementing them in Node.js
Let's dive in and see how we can implement cookies using Node.js. ... This is the port number that the server should listen...
Read more >
Express cookie-session middleware
Installation is done using the npm install command: ... secret. A string which will be used as single key if keys is not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found