Firebase Authentication Error

I kept getting this error when I followed the tutorial to set up Firebase deployment

Error: HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Any help is appreciated

Most likely your credentials are incorrect at the deployment time. If you encrypted your credentials, they were probably encrypted incorrectly. Try specifying the repo with -r, and the endpoint with --pro (for .com), or --org (for .org); e.g.,

travis encrypt -r OWNER/REPO --com

Alternatively, try setting it on the settings panel.

1 Like

I am not successful with the approach. Anyone else is lucky with this?

Setting edge to true has seemed to resolve the problem.

This could possibly be because of a recent change to the firebase-tools which has fixed the issue.

1 Like

Try this:

script:
- npm test
- npm run build
after_success:
  - firebase use --token $FIREBASE_TOKEN YOUR_FIREBASE_PROJECT_ID
  - firebase --non-interactive --token $FIREBASE_TOKEN

hey - could you clarify how you set this flag? We’re experiencing the same issue. Tried setting

deploy:
  provider: firebase
  project: XXX
  edge: true
  token: 
    secure: XXX

but that didn’t work.

All configurations here looks correct. However, If you happened to be trying to deploy a web application built be webpack on Firebase Hosting you might want to try to set you cleanup option to persist the built artifact.

Thanks - we were using the clean argument, turned I we hadn’t got the syntax right, and @BanzaiMan’s solution worked for us after all. That is

travis encrypt “1/BLAHBLAHBLAH” -r org/repo --com --add

1 Like