I am using firebase app distribution via firebase CLI in bitbucket pipeline to deploy app to the firebase.
As long as i started to get errors:
HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential.
And FIREBASE_TOKEN method will be deprecated and removed soon i decided to use GOOGLE_APPLICATION_CREDENTIAL for authentication.
Unfortunately i cannot authenticate with GOOGLE_APPLICATION_CREDENTIALS,
- firebase appdistribution:distribute
request just fails with error, just ignoring GAC at all.
Error: Failed to authenticate, have you run firebase login?
Reading firebase docs and troubleshooting for last three days but cant get it working.
- Google service account created, with Firebase App Distrib. Admin role.
- JSON Key generated.
- JSON key contents is directly declared in private GOOGLE_APPLICATION_CREDENTIALS variable.
If i echo GOOGLE_APPLICATION_CREDENTIALS variable public i am getting exact JSON key contents just as i would get it from JSON file, so it should work in theory (I am trying to
{ "type": "service_account", "project_id": "xxxx", "private_key_id": "xxx, "private_key": "-----BEGIN PRIVATE KEY-----nxxxxxn-----END PRIVATE KEY-----n", "client_email": "xxxx", "client_id": "xxxx", "auth_uri": "xxxx", "token_uri": "xxxx", "auth_provider_x509_cert_url": "xxxx", "client_x509_cert_url": "xxxx", "universe_domain": "xxxx" }
But firebase CLI does not use it for auth. anyway.
Pahom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.