-
Notifications
You must be signed in to change notification settings - Fork 1k
Auth Emulator and createSessionCookie /validDuration should be string #2770
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
@royletron where is your express server running? Right now the Admin SDK only accepts emulated ID Tokens when running inside of the Cloud Functions emulator. This is a decision we made for security reasons, although we are open to reconsidering this based on developer feedback. |
@samtstern express is just running locally not inside the functions emulator. In prod we run a server on CloudRun so this is more related to our use case |
@royletron ok thanks for clarifying. Right now there's not much you can do about this ... we'd like to expand the situations where we can support verifying emulated tokens but we're still debating the right way to do that. |
@royletron this feature request is being tracked over here: #2764 I'm going to close this one so we can focus the discussion in one thread. |
@samtstern I think this is a real issue, actually! I'm encountering it even though I'm executing I note that the OpenAPI schema for |
@andymatuschak thanks for digging into that! Filed: 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
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
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. |
[REQUIRED] Environment info
firebase-tools:8.14.1
Platform:macOS
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
This is using
firebase-admin
on anexpress
backed server, with a front end usingfirebase
andfirebase/auth
. These are all connected to the firebase emulator running both firestore and the new auth. You'll need to get an ID token for a user (not sure if it has to be valid or not), and then pass this to thecreateSessionCookie
example above. It should fail with the errorInvalid JSON payload received. /validDuration should be string
. This doesn't happen if I connect to a live Firebase project, only when using the emulator.[REQUIRED] Expected behavior
That we receive a cookie that we can send back to the client.
[REQUIRED] Actual behavior
The text was updated successfully, but these errors were encountered: