SPA Authentication in general:
https://stormpath.com/blog/token-auth-spa
Firebase authentication REST API:
https://firebase.google.com/docs/reference/rest/auth/