Sometimes you want to upload some JSON data to Firebase Realtime Database. Usually this means generating a service account and writing a script that uses Firebase SDK to upload that data.
If you installed Google Cloud SDK, such token can be generated using the following command:
gcloud auth print-access-token
The access token has access to all projects you own which makes this very convenient. That means you can now do this:
cat FILE.json | \ http put https://PROJECT.firebaseio.com/REF.json \ "Authorization: Bearer $(gcloud auth print-access-token)"