Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Authentication required #160

Closed
zosocanuck opened this issue May 29, 2016 · 12 comments
Closed

Error: Authentication required #160

zosocanuck opened this issue May 29, 2016 · 12 comments

Comments

@zosocanuck
Copy link

Hi,

I recently upgraded to the new Firebase console however when running firebase deploy I get

Error: Authentication required.

So I logout and then login again however still get the same results.

Any ideas?

@mbleigh
Copy link
Contributor

mbleigh commented May 31, 2016

Can you please run firebase deploy --debug and paste the output here? Also, what do you get when you run firebase list? Do you see the project there?

One final thing to check is to make sure that you are deploying to the project id not the subdomain of your app.

@zosocanuck
Copy link
Author

Ok, I ended up upgrading nodejs on my windows laptop and firebase list did show my projects. But when I run firebase deploy I get:

Error: Unable to authorize access to project milohas

Note: This version of the Firebase CLI is only compatible with projects upgraded
to the new Firebase Console. To access firebase.com apps, you will need to
use a previous version: npm install -g firebase-tools@^2.1

I do have permission to access this project as I am successfully able to run firebase deploy on a Fedora 23 VM.

@mbleigh
Copy link
Contributor

mbleigh commented Jun 20, 2016

When you run firebase list, do you see a different project id and instance name for this project? If so, make sure your .firebaserc file has the project id not the instance/subdomain name.

@hickford
Copy link

hickford commented Jul 16, 2016

I have the same problem:

$ firebase deploy
Error: Authentication required.
$ firebase login
Already logged in as ****@gmail.com

This happened after 'upgrading' my app from the 'legacy console' at https://www.firebase.com/account/ to https://console.firebase.google.com/

@tavosansal
Copy link

Having the same issue here. When I do firebase list I do not see my project. I recently upgraded to the new Firebase and started getting these issues. Some help on this would be appreciated since I can no longer deploy my project. Is there a way to manually deploy stuff??

@tavosansal
Copy link

Any update on this? I literally cannot deploy any updated with a fix for this.

@hickford
Copy link

hickford commented Sep 18, 2016

@tavosansal try downgrading npm install -g firebase-tools@2. I worked it out eventually; firebase-tools@3 is incompatible with "legacy console" apps at https://www.firebase.com/account/

Frustrating isn't it?

  1. Client is not backwards compatible
  2. Readme neglects to warn about backwards incompatibility
  3. Backwards incompatible client gives unhelpful and misleading error message "Error: Authentication required" rather than explain the problem and how to workaround it

@Lionardo
Copy link

I have the same issue for a while now. I tried a couple of things like downgrading firebase-tools@2, I have the project id on .firebaserc and no subdomain but nothing works. I get no project listed on firebase list but i clearly have a project on the dashboard. I also tried to deploy with a FIREBASE_TOKEN but without success. Here is my firebase --debug

Error Context: {
  "requestOptions": {
    "method": "GET",
    "json": true,
    "url": "https://admin.firebase.com/firebase/talentmap/token?token=-KFQF7KUYFZ7AvBQG_FN%7Ca3600ce1d3feedf3bb38df18a5e3199f"
  },
  "body": {
    "error": {
      "code": "AUTHENTICATION_REQUIRED",
      "message": "Authentication required."
    }
  },
  "response": {
    "statusCode": 401,
    "body": {
      "error": {
        "code": "AUTHENTICATION_REQUIRED",
        "message": "Authentication required."
      }
    },
    "headers": {
      "server": "nginx",
      "date": "Sun, 27 Nov 2016 14:30:16 GMT",
      "content-type": "application/json; charset=utf-8",
      "content-length": "81",
      "connection": "close",
      "access-control-allow-origin": "*",
      "access-control-allow-methods": "GET, PUT, POST, DELETE, OPTIONS",
      "x-content-type-options": "nosniff"
    },
    "request": {
      "uri": {
        "protocol": "https:",
        "slashes": true,
        "auth": null,
        "host": "admin.firebase.com",
        "port": 443,
        "hostname": "admin.firebase.com",
        "hash": null,
        "search": "?token=-KFQF7KUYFZ7AvBQG_FN%7Ca3600ce1d3feedf3bb38df18a5e3199f",
        "query": "token=-KFQF7KUYFZ7AvBQG_FN%7Ca3600ce1d3feedf3bb38df18a5e3199f",
        "pathname": "/firebase/talentmap/token",
        "path": "/firebase/talentmap/token?token=-KFQF7KUYFZ7AvBQG_FN%7Ca3600ce1d3feedf3bb38df18a5e3199f",
        "href": "https://admin.firebase.com/firebase/talentmap/token?token=-KFQF7KUYFZ7AvBQG_FN%7Ca3600ce1d3feedf3bb38df18a5e3199f"
      },
      "method": "GET",
      "headers": {
        "accept": "application/json"
      }
    }
  }
}

@arangates
Copy link

i faced same issue ... i did firebase logout and then tried again.Everything worked out !

@ckunta
Copy link

ckunta commented May 10, 2017

I'm facing the same issue from last night. No change on the firebase-cli and I was able to deploy successfully earlier (about 3 hours prior). I tried login/logout but still not working. I noticed that running curl I received 'AUTHENTICATION_REQUIRED' return. And running firebase deploy I received 'Auth token is expired', but I don't know how to renew it. I can still get into the Firebase console with the same account without any problem.
Here are the capture.

curl https://admin.firebase.com/v1/database/fir-auth-a8de1/tokens
curl : {"error":{"code":"AUTHENTICATION_REQUIRED","message":"Authentication required."}}
At line:1 char:1

firebase deploy --debug


Command: C:\Program Files\nodejs\node.exe E:\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase deploy --debug
CLI Version: 3.2.1
Platform: win32
Node Version: v4.4.4
Time: Wed May 10 2017 07:05:35 GMT-0600 (Mountain Daylight Time)

.....

command requires scopes: >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/fir-auth-a8de1/tokens
<<< HTTP RESPONSE 200 server=nginx, date=Wed, 10 May 2017 13:05:33 GMT, content-type=application/json; charset=utf-8, content-length=427, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cac
he, no-store

=== Deploying to 'fir-auth-a8de1'...

i deploying database, hosting

  • database: rules ready to deploy.
    i hosting: preparing build/unbundled directory for upload...

HTTP REQUEST PUT https://deploy.firebase.com/v1/hosting/fir-auth-a8de1/uploads/-KjmSjLly1XDXU2bv9tZ?fileCount=1630&message=
FIREBASE WARNING: auth() was canceled: Auth token is expired.

<<< HTTP RESPONSE 401 server=nginx, date=Wed, 10 May 2017 14:55:53 GMT, content-type=application/json; charset=utf-8, co
ty=max-age=31556926; includeSubDomains; preload, x-content-type-options=nosniff
<<< HTTP RESPONSE BODY undefined
TypeError: Cannot read property 'error' of undefined
at module.exports (E:\AppData\Roaming\npm\node_modules\firebase-tools\lib\responseToError.js:10:12)
at Request._callback (E:\AppData\Roaming\npm\node_modules\firebase-tools\lib\api.js:37:25)
at Request.self.callback (E:\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\reques
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request. (E:\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.
at emitOne (events.js:77:13)
at Request.emit (events.js:169:7)
at IncomingMessage. (E:\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request
at IncomingMessage.g (events.js:260:16)

Error: An unexpected error has occurred.

@saifalfalah
Copy link

I removed firebase.json and .firebaserc and ran firebase init again. It worked.

@ckunta
Copy link

ckunta commented Nov 3, 2017

Thank you. I'll keep that in mind if it happens again. I don't remember how I resolved it then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants