Missing or insufficient permissions question for HTTP calls

Hi Everyone,

I changed my firebase rules to require authentication when writing data and am getting the “Missing or insufficient permissions” error when I test it out using HTTP post call.

rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow write: if request.auth != null; //need to be authenticated to write (or use “if false”)
allow read: if true;
}
}
}

I found another thread that stated I need to get the idToken and pass that in the call to get it to work. I added the get id token flow function (see below) and then store that as a app variable.

I then added that to the header as a custom list in the http call.

However, I am still receiving the “Missing or insufficient permissions” error. Does anyone know what I am missing here? The request header details are below:

Did you compare your setup already with the description in this post?

My first impression is, that you are missing the string 'Bearer ’ before the idToken.

Thanks @stayfoolish that was it!

My updated config is below to close this out.