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

authentication_disabled error #16

Open
chuank opened this issue Oct 31, 2016 · 17 comments
Open

authentication_disabled error #16

chuank opened this issue Oct 31, 2016 · 17 comments

Comments

@chuank
Copy link

chuank commented Oct 31, 2016

Hi there, thanks for contributing this node – it's been working very well for me with the 2.x firebase sdk.

I'm now having trouble with authentication for new 3.x databases. My node-RED installation is on a local deployment.

The first thing I tried was the email authentication method and got the "AUTHENTICATION_DISABLED" message on the debug window. This despite enabling the correct email account user/password to my firebase project. As a test I've set the database rules to be totally open, but I'm still getting the same error. Needless to say I didn't go very far with the JWT/custom tokens.

Any tips? Much appreciated.

@deldrid1
Copy link
Owner

Can you give a little more information on the details? What do you consider to be a 3.x database?

I've tested the nodes and can confirm they work fine on Firebase "Realtime databases" migrated to the new console from the legacy firebase.com. I believe all of the 2.x SDK's and auth methods continue to be supported?

If you're wanting to use a new form of auth not supported in the 2.x SDK's or perhaps created a new DB in the new console then perhaps that is the problem? All of the open issues are meant to serve as a complete rewrite of the nodes to get to SDK 3.x and add some features that I never got around to or that have been since added to node-red, but time hasn't been on my side to get it done just yet...

@chuank
Copy link
Author

chuank commented Nov 1, 2016

Hi @deldrid1,

My old databases that were upgraded from the 2.x SDKs stayed working, using JWT authentication.

The issue, as you have hinted, is with new DBs using the 3.x SDK (firebase no longer allows creation of DBs using the 2.x sdk / legacy console).

For clarity, what I did is this:

  • create a new firebase project
  • go to Authentication > Sign-in method, enable Email/Password
  • go to Authentication > Users, and add a new user/password (to test the email/password authentication)
  • back to NR, set the right credentials

That done, when I hit Deploy I get a momentary "connected" status on the firebase node, before failing to the "AUTHENTICATION_DIASBLED" error.

@deldrid1
Copy link
Owner

deldrid1 commented Nov 1, 2016

Are you sure that you have your Firebase configured properly? Do you have any sign-in providers setup under Authentication -> Sign-in Methods and/or are you using auth type of None in your config nodes?

https://firebase.google.com/docs/auth/server/create-custom-tokens seems to indicate that all the old ways of using JWT's are still valid... I'm thinking you just have a configuration issue.

@chuank
Copy link
Author

chuank commented Nov 1, 2016

I tried that, as per my previous comment, using just basic username/password authentication. That didn't work – 'AUTHENTICATION_DISABLED'. This despite setting up my sign-in providers and users in the firebase console.

image

Next I attempted to create a custom token. I generated my service account credentials as a JSON file, which I then used to create a custom token from node. This custom token, when pasted in to your node as a JWT secret, did not work – 'INVALID_TOKEN'.

Yes this is definitely a configuration issue, but I'm not sure what I did wrong.

@tomskidoodle
Copy link

Has this problem been resolved? I am new to Firebase and these nodes, but I'm having exactly the same issue. I have tried both password and anonymous credentials (along with the same Auth settings in Firebase) but persistently receive a 'Authentication_Disabled' message.

@deldrid1
Copy link
Owner

Unfortunately, not yet. I believe @ssolemon was working on upgrades to get the lib to Firebase SDK 3 but I don't think they are stable enough to merge just yet...

@tomtom30
Copy link

I have the same issue.
Authentification disabled with email auth and invalid token with json web auth.

@tomskidoodle
Copy link

Ok, thanks, I shall await it eagerly!

@ottopaulsen
Copy link

ottopaulsen commented Feb 9, 2017

I have this problem too, and I just discovered that the error received at line 186 in firebase_config.js says:

Error: Projects created at console.firebase.google.com must use the new Firebase Authentication SDKs available from firebase.google.com/docs/auth/

I guess the problem is for all databases created with Firebase 3, and that the only solution is to upgrade to using the FB3 SDK. Is there any code for this available? I would be happy to test :-)

@ejeklint
Copy link

This is an awesome project! Would love to help overcome this issue as it's a show stopper for me right now - I'm looking into using node-red in a "real" project and auth is of course a needed thing. :)

@deldrid1
Copy link
Owner

Happy to accept PR's :)

The fixes being worked on as a part of #11 address all of these issues - unfortunately, I don't have bandwidth to manage doing the wrench turning myself right now and @ssolemon branch is working"ish" but isn't ready to pull-in to the npm published lib...

@ejeklint
Copy link

I'll see what I can contribute with, being a rather slow js developer. 🐌

One question: what's the opinion about using the Admin side of the Firebase API instead of current client approach? It might be a bit simpler to implement and aligns better with node-red acting as a server component towards firebase.

@deldrid1
Copy link
Owner

Take a look at ssoleman@b5d0e5b if you are looking to advance something...

I think there is a place for both the client and admin libraries to be present for these nodes. There are some functionalities that you only get when using the Admin SDK, however, it comes at the cost of having to have admin access to the Firebase backend and having the full set of private keys, etc.

The client library can probably perform 80% of use cases while being able to support auth strategies such as email/password.

I think that both are valid use cases that I would like the lib to be able to support (and they were both supported until Firebase made breaking changes in v3...)

@mendeljacks
Copy link

So is there any way to use firebase from Node-Red? Currently I'm still getting "AUTHENTICATION_DISABLED" error.

@chuank
Copy link
Author

chuank commented Mar 18, 2018

@mendeljacks have a look at ssoleman/node-red-contrib-firebase

@mendeljacks
Copy link

I have settled for using the JSON web token option and manually copying the key from the service worker section of firebase. Even though firebase indicates this method is deprecated it still seems to be working for now.

@bourton88
Copy link

I have settled for using the JSON web token option and manually copying the key from the service worker section of firebase. Even though firebase indicates this method is deprecated it still seems to be working for now.

@mendeljacks I have two questions.

  1. How did you set tte database rules in Firebase?
  2. Did you use the Token from the automatic generated .json service file between "-----BEGIN PRIVATE KEY-----\n CODE \n-----END PRIVATE KEY-----\n"?

I always getthe Node Red error "Received msg before firebase modify node was ready...."}" and Firebase is disconnected

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