Can someone help me to solve this error I cannot run firebase init command before running firebase deploy.
Error: Authentication Error: Your credentials are no longer valid. Please run firebase login --reauth
For CI servers and headless environments, generate a new token with firebase login:ci
if you are behind proxy invoke set "NODE_TLS_REJECT_UNAUTHORIZED=0"
as described here
Your credentials are not valid
All you need is to login again
Try the command firebase login --reauth
For such Authentication Error from Firebase CLI.
Do the below steps:
1. firebase logout
2. firebase login
3. Once the URL opens, go to Google account and remove access which was already given to firebase app distribution ["Remove Access"]
4. Come back to the URL window and select Allow
5. Should result in a successful login
Even after this repeatedly getting Firebase login CLI issue - suggest restart your system and do firebase login again
Hope this helps!
Please try this command
set "NODE_TLS_REJECT_UNAUTHORIZED=0"
and then re-run,
firebase login
Related
I just registered my own domain on GCP and instead, created a new GCP. I wanted to migrate my old GCP to new one. So, I signed in using firebase login:ci. The new window opened up to choose my account and I used my new assigned account for registered domain on new GCP. Then I run firebase init inside. I got this error after selecting firebase project I created using a new GCP.
Error: HTTP Error: 403, Permission denied to get service [firestore.googleapis.com]
Help Token: AWzfkCMe3kI1xtpLJkoCpzQg-sn3fQt7oX8VPut5qpv5cBZcYLNuMwx9Ml1UofnrC9fStBNhbTPnPBJlx-jiM4Br3U-pBp91mmYWnqnrOxClIEQY
The firebase login:ci command is used for authentication in CI pipelines. To authenticate yourself to for Firebase CLI, use firebase login.
Checkout the documentation for more information.
As mentioned by #Dharmaraj you can use firebase login to Log into Firebase using your Google account. This command connects your local machine to Firebase and grants you access to your Firebase projects.
I just deploy my react app to firebase , after deployment I am having trouble getting the Firebase Google sign-in to work and got the error :"This domain (*********.web.app) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab."
see the error in below pic:
See This
also I've whitelist the domain and add it to authentication tab
See This
,but don't know why I still got the error. Can Anyone help me with this issue?
This problem is likely due to the sign-in methods that are enabled. In the firebase console, you need to enable the Google sign-in method
I am trying to login to the Firebase Tools CLI with a GCP service account. I have the path to the service account credentials saved as GOOGLE_APPLICATION_CREDENTIALS. I have logged out of firebase with firebase logout and have tried to sign in with the service account with firebase login --no-localhost and firebase login --no-localhost --token $GOOGLE_APPLICATION_CREDENTIALS. However in bother cases a web browser opens asking me to log in with my user account. How can I log in to firebase with a service account?
Taken from Michael Bleighs comment:
"The Firebase CLI does support GOOGLE_APPLICATION_CREDENTIALS, but you don't need to "log in" with them. If the environment variable is pointing to a valid service account you should be able to just use CLI commands as if you are logged in. You do need to be logged out for GAC to work correctly. Run the command with --debug if you're getting errors while trying to do so."
I can confirm I have this working. Note you might need to run firebase use <project-id> for it to work correctly.
You can't sign in to your Firebase project with a service account. You will need to use the proper user account of a collaborator on the project to sign in with Firebase tools.
Even when using the CI integration, the documentation says to:
Start the signin process by running the following command:
firebase login:ci
Visit the URL provided, then sign in using a Google account.
So I'm minding my own business trying to initializing a Firebase project in my Angular app when all of the sudden I'm hit with this error:
Error: Failed to list Firebase projects. See firebase-debug.log for more info.
To get to that point, I followed the instructions in the documentation here which are basically run:
$ npm install -g firebase-tools
$ firebase login // Turns out I was already logged in
$ firebase projects:list // Make sure you can access your account.
Anyway, back to the error. "Ok," I think. "I'll just check out the log it's pointing me to." I open the log and see:
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.`
`FirebaseError: 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.`
The part about "invalid authentication credentials" makes me think it has something to do with me not being logged into firebase but firebase login shows I am logged in.
The URL in the log just takes me to the docs for using firebase auth in my app. Well, I would love to. But first I need this command to work, Firebase.
Has anyone run into this/have a solution for it?
Update
The fix is:
$ firebase login --reauth
Thanks to #kynan in the comments for simplifying the original two-liner down to this one-liner.
If that doesn't work, you can also try logging out and logging back in like the original answer.
Original Answer
The fix is:
$ firebase logout
$ firebase login
It looks like when you upgrade firebase-tools, that may invalidate your auth token. You just have to log out and log back in.
Here's the message when you log out:
$ firebase logout
! Invalid refresh token, did not need to deauthorize
+ Logged out from <email>
For people who don't want to logout, the below command will also work.
firebase login --reauth
use firebase logout to log out
then use firebase login to log back in to firebase in the CLI
Do this after updating the firebase tools using npm install -g firebase-tools
After succesfull login, use firebase use --add to list all the projects you have
for Who don't want to logout, the below command also work
firebase login --reauth
First go to command prompt and run below code then execute above code.
In Command Prompt:
Run : powershell Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
In my case that it couldn't list my firebase projects, I try to access firebase by vpn that I was installed on my system (not my browser), and it worked. Then I could initial firebase in my project as hosting and deploy it.
Okay so for me it was the problem of the wifi I was using. Apparently the wifi had been denied access to firebase so I used vpn and it worked like charm. You can try using a vpn to see if it would come
I encountered Exact same error but for a different reason. I was configuring Flutter app for Both iOS and Android. My bundleId contained a _ in it. so when I tried
flutterfire configure
Then my android app would configure just fine but iOS would not. and give this error. So if the above solution isn't working for you like me please check your bundleId or package Name. it can be the culprit.
I have logged in into firebase.com using my google account.
Now in command prompt I am doing
>firebase init
and it keeps on asking me about email and password.
Since I logged into via google , I am not sure what is password for firebase account. I have enabled email and password authentication in my app and added users also but still not able to successfully login via firebase init command.
Any suggestions?
You're likely using a version of the Firebase command line tools that don't support Google authentication yet. To upgrade, run:
npm update -g firebase-tools
After that running firebase login will pop up a browser window where you complete the Google sign-in.
There is now an interactive flag that you can add that opens the browser and you can log in using your google account/credentials that way:
firebase login --interactive