title: Building a REST API, using firebase as a backend
body: <p>Currently, I am using firebase to store data, I would like to expose some of the data by creating an API that others can consume. I am using this documentation as reference <a href="https://firebase.google.com/docs/reference/rest/auth/" rel="nofollow noreferrer">https://firebase.google.com/docs/reference/rest/auth/</a>
  The user is created by issuing an HTTP POST request to the Auth signupNewUser endpoint. The response is an id token which is valid for an hour. Is this the token to be used for allowing a user to access API endpoints? I see that there are four types of token which firebase provides and I am not sure which one to use and when. Which token should be used to authenticate a user who will consume an API and which token should be used to authorize which access a user should have? Also, my other concern is that in order to use firebase rest API to create a user it requires to have API key attached to every request, is that a safe practice?</p>