1

I am trying to access the firebase REST API from a cloud function, using the built-in functions.config().firebase object (my use case is a shallow query).

const { credential } = functions.config().firebase; credential.getAccessToken().then( ({ access_token }) => { // use access_token as auth param to query the REST API }); 

When I use the returned access_token as the auth parameter in the REST API, I get the could not parse auth token error. Is there a way of generating there a valid auth token without exposing in the config the database secret ?

Many thanks for your help.

1 Answer 1

1

Turns out this is a correct way of generating an authentication token, but that with this token, one need to use an access_token param instead of the documented auth one.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.