Firebase Webhook Using Console Configurator

I’m just working on creating a Firebase integration, I am getting the 404 Error when testing in the console web browser. Is there a newer tutorial that is made to explain how to setup the firebase webhook? Seems the images a kinda outdated, which is fine, but the tutorials don’t have the latest snapshots from the console integrations creator as well.

Which tutorial are you using? This one is old, but I think it should still work. Once you get past the first few layers of creating a Particle webhook the inner pages where you enter the settings are similar.

If you're getting a 404 it typically means the URL is wrong. See the "How the pieces connect together" for how the host name and database name need to connect together.

If you are using one of the more advanced examples like per-device tables, those will not work from the console test button because it won't contain the device name needed to fill in the URL.

Also beware of the authorization, which is the next step after getting past the 404. This tutorial requires a classic token, and there's always a chance that Google will finally deprecate the use of the classic token and this technique will no longer work.

Yes I am using the tutorial you mention. A few things different that I am doing are:

Accessing a Firestore database. Here is a picture of my basic setup.

The next thing I’ve got is setting up the console webhook. The project id is whited-out. I’m not entirely sure that is the appropriate url for the firestore databases.

and then i added the private key as a secret in particle console for the firebase auth token

image

Is there something wrong with the URL?

Does the Auth Token need to include the ‘—–BEGIN PRIVATE KEY —’ portion of the key and the ‘—–END PRIVATE KEY—–’?

After this webhook is created I see these items here. Is the FIREBASE_AUTH_TOKEN supposed to be embedded in my particle device firmware somewhere? Seems there is supposed to be a specific json format to get all the parameters send the to the webhook correctly but what would that format look like?

When I run this in the console as a test, I get error status 400. I was getting error status 404 until I changed the URL. I saw from another topic in the community that the format of the json was causing the 400 message. I’m not sure how the json piece is supposed to be formatted in my particle firmware.

You can't use the private key. That's the modern way to authenticate and does not work with a webhook.

At least there used to be a way to generate a classic token for Firebase that's a short static string that never changes. It may have already been removed.

Ok, so the classic token method is long gone. Does this mean the firebase integration with Particle is also pretty much EOL as well if the webhook requires a token that can no longer be generated? If that’s the case then I’ll just look at other integrations that particle uses instead.

I think it should be possible to generate Google/Firebase authentication using Logic but I never tried it. But using one of the off-the-shelf options is probably easier. You can also use the Particle events to Google pubsub as the entry point and route that to Firebase from within Google.