-
Notifications
You must be signed in to change notification settings - Fork 391
createSessionCookie uses number when it should use a string #1084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am gettting this error also, have you found a work-around until it gets resolved? |
It seems somehow to be accepting both string and number. If we can verify that, we can safely convert to string in the Admin SDK implementation. It should have no visible impact on customers. |
Are there any news about this? |
I am also receiving same error when calling |
This is blocking the local development in case of emulating session cookie creation. |
So while experimenting, with my install of firebase-tools, I edited
|
@aaronosher seems to be only usable when combined with the functions emulator: firebase/firebase-tools#2764 |
According to firebase/firebase-tools#2770 (comment) `validationDuration` should be a string. The production environment also accepts numbers, but the emulator does not. Related: firebase/firebase-admin-node#1084
According to firebase/firebase-tools#2770 (comment) `validationDuration` should be a string. The production environment also accepts numbers, but the emulator does not. Related: firebase/firebase-admin-node#1084
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) |
I don't think any further changes in the Node.js Admin SDK is required, although it would still be nice to use the right data type, it shouldn't block local development now. |
Originally reported here
firebase/firebase-tools#2770 (comment)
@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, butfirebase-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 afirebase-admin-node
bug, although clearly the production auth server is accepting numbers for this parameter.Originally posted by @andymatuschak in firebase/firebase-tools#2770 (comment)
The text was updated successfully, but these errors were encountered: