title: Firebase Cloud Functions HTTP Basic Auth
body: <p>I need to create an API endpoint that returns PDFs. This endpoint is intended to be accessed by Twilio to use with their faxing API. However, the only way to do this with authentication is with <a href="https://www.twilio.com/docs/usage/security" rel="nofollow noreferrer">HTTP Basic Auth</a>.</p>
  <p>Doing this seems easy enough with the <a href="https://www.npmjs.com/package/express-basic-auth" rel="nofollow noreferrer">express-basic-auth</a> npm package. However, I'm not sure about the logistics with my tech stack. I use Firebase, Firestore and Cloud Functions.</p>
  <p>How can I securely implement this HTTP Basic Auth with Cloud Functions? I can't use Firebase's Auth product bc like I said, another API needs to interact with this endpoint, not an actual person. I will have numerous internal username &amp; passwords, should I store these in a database, Firestore? Hardcode it in an array in the function?</p>
  <p>The ultimate question is, <em>should</em> I store the username passwords in a Firestore document?</p>