Using firestore with token from Google cloud endpoint


I can’t use firebase native auth in appgyver since I need to get the token via a google cloud endpoint. With the token and IdI get from Google Cloud can I use appgyver native firebase connector or do I need to use REST API? For the native firebase connector I don’t see option to give token and specific id (text)

if I use the REST API I use{xxx_id}

the xxx_id is set to app variable id received from Google Cloud and I add “token” to the header received from Google Cloud. I get this error

Error: JSON error response from server: {“error”:{“code”:401,“message”:“Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See",“status”:"UNAUTHENTICATED”}}.status: 401

Yes! You need to use REST API.

The answer for your second question is in this post: Firestore; security rules : if request.auth != null; - #21 by stayfoolish

@Alan_Alves thanks for the comment, unfortunately looking at the other post it looks to do the same as myself. I’m using the REST API with GET and I set the token to the header with “bearer + {token}”

Would you be able to provide more details and some screenshots?

Don’t forget to put a space between Bearer and the id token: “Bearer ” + {idToken}. First letter capitalized “Bearer ”.