createSessionCookie uses number when it should use a string
See original GitHub issueOriginally 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:
- Created 3 years ago
- Comments:9 (3 by maintainers)

Top Related StackOverflow Question
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)
Are there any news about this? Unfortunately, I haven’t found a workaround yet and the topic restricts local development considerably.