firebase with nodejs Error creating user: - firebase-authentication

I have the below error ... when i try to create a nue user with firebase in nodejs . I was activated de authentication in firebase console but nohting works for me.
i am using this link of docs:
https://www.firebase.com/docs/web/api/firebase/createuser.html
Error creating user: { [Error: The specified authentication provider is not enabled for this Firebase.]
code: 'AUTHENTICATION_DISABLED',
details: 'Projects created at console.firebase.google.com must use the new Firebase Authentication SDKs available from firebase.google.com/docs/auth/' }

Looks like you are using the documentation for 'old' Firebase to set up a connection to a 'new' Firebase environment. I was having the same problem. The answer is in the error message - take a look at the docs at the new Firebase Authentication SDK as things have changed. Or, alternatively, create an environment using the old Firebase (www.firebase.com) and the documentation you are referencing should work. (Not sure how long before the 'old' Firebase is deprecated, though.)

This error was produced becouse we cant authenticate from server side ,
"auth" is only allowed for client side,
i am working with an android app , and i create a new user from android , it works , my server side with node only conects with firebase for listening changes in database (firebase) .
Thanks for the observation.. and best regards

Related

Problem with Azure AD B2C MSAL authentication

I'm trying to add basic authentication to a Vue.js spa. I'm following the tutorial on https://learn.microsoft.com/en-us/azure/active-directory-b2c/tutorial-single-page-app
In case of the sample SPA provied by MS everything works. When I try to do the same in Vue.js I get the following error:
"ClientAuthError: access_token_entity_null: Access token entity is null, please check logs and cache to ensure a valid access token is present." when doing
.then(handleResponse)
.catch(error => {
console.log(error);
});
However after refreshing the page user seems to be logged in:
myMSALObj.getAllAccounts()
returnes the account used during the login.
What I may be doing wrong? I was unable to find any useful info about it :(
As mentioned in the comments using an older version of the library solved the problem.
This issue seems to have been solved in version 2.14.2
Instead of downgrading you should try upgrading :-)

Empty object user when authenticating with Realm.Credentials.jwt(token) and Realm connection issue with RN hot reload

I am trying to use Mongo Realm (v10.0.0-beta.9) ; I use a JWT authentication (token being generated by AWS Cognito). It works pretty well since a user has been created (in Mongo Realms Users menu) and I was able to insert a data in my realm. But...
1. Empty user object
One strange thing nevertheless: the user I get from the authentication is empty
const credentials = Realm.Credentials.custom(jwt)
// Authenticate the user
const user: Realm.User = await app.logIn(credentials)
console.log("logged in with Jwt, user:", user) // display "logged in with Jwt, user: {}"
Is it normal? Examples speak about a identity field: console.log(`Logged in as ${newUser.identity}`);
2. React Native hot reload
A bothering thing: I can't reconnect to a realm when reloading the app (pressing r in the console where I npm started). I don't get any error, I just get... nothing. No log appears in Realm console.
The only solution I get is to kill the app, then restart it.
Did I miss a trick to handle that reconnection with RN hot relad?
I've had some troubles converting any Realm objects to printable strings; I always get {} just like you do. I think it could be related to this (unresolved) task on their GitHub.
On a similar note, there are some bugs in Realm's authentication system. I'm trying to get email/password, Facebook, and Google authentication going in my application but all of them currently seem to be broken on Realm's side.
Here are some related issues on their GitHub that you can follow for a solution.
Facebook
Google
Email/pass (fixed, but not released in the latest beta)
I don't have any information about JWT specifically but given these other authentication issues there's a good chance the issue isn't on your side. I recommend opening an Issue on their repository.

Xero - OAuth1 to OAuth2 migration

I started working with adding migration from OAuth1a to OAuth2 inside my application and i face some problems.
This is what I've done :
I updated my partner app just like it is described here https://developer.xero.com/documentation/oauth2/migrate (added Auth2.0 redirect , got client id and secret etc ...)
I implemented token migration exactly as it is done here https://github.com/XeroAPI/xero-net-oauth2-sampletokenmigration and it works fine when OAuth1 token is valid :)
But when it is invalid and I'm doing refresh (using app updated in step 1) and call ~/oauth/migrate endpoint (using access token that i just recived after refresh step) to get OAuth2 token. I'm reciving this error "You can only migrate an OAuth1.0a connection to an OAuth2.0 connection for the currently authorised app". Also same thing happen when i create new connection (using partner applications created in in step 1) and than try to migrate this access token to Auth2.0.
Can anybody point me what I'm doing wrong ?
That is the error returned when you try to migrate to a newly created app. Are you sure you are using the tokens from the same Partner app tile in your /myapps dashboard.
It should look something like this, once you've added the correct OAuth2 redirect uri and generated your secret.

AngularFire 2.0.1 $createUserWithEmailAndPassword auth/invalid-api-key

I am trying to create a Firebase user from AngularFire 2.0.1 (Firebase 3.0.5) using:
$createUserWithEmailAndPassword(email, password)
The api returns an error:
{"code":"auth/invalid-api-key",
"message":"Your API key is invalid, please check you have copied it correctly."}
The config for the app looks like this:
{apiKey: "my_verified_key",
authDomain: "my_verified_project_id.firebaseapp.com",
databaseURL: "https://my_verified_project_id.firebaseio.com/"}
where my_verified_key is the database secret found at
https://console.firebase.google.com/project/my_app/settings/database
my_verified_project_id is the ProjectId found at
https://console.firebase.google.com/iam-admin/settings/project?project=my_verified_project_id&consoleReturnUrl=https:%2F%2Fconsole.firebase.google.com%2Fproject%2Fmy_verified_project_id%2Fsettings%2Fgeneral%2F
In the network log I see that the error comes from a POST to
https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=my_verified_key
I have checked that identity toolkit api is enabled for my app.
I've tried disabling/enabling email/password authentication in the Firebase control panel as suggested elsewhere.
I have tried to create the user from the node library but it seems that most of the auth functionality is not implemented there.
Make sure you are getting the correct API Key. Go to the firebase console page:
https://firebase.corp.google.com/project//authentication/users
Click WEB SETUP on the top right corner:
The snippet provided will contain the auto generated api key for you to user.

Google Analytics API authentication

I was using this code until yesterday:
$gaemail = 'my email';
$gapassword = 'my password';
$gaprofileid = 'my profile id';
require 'gapi.php';
$ga = new gapi($gaemail,$gapassword);
Today it started giving me the error:
Exception: GAPI: Failed to authenticate user.
Error: "https://developers.google.com/accounts/docs/AuthForInstalledApps " in C:\wamp\www\projects\gapi.php on line 418
Was there any changes recently regarding the authentication process?
See: GAPI: Failed to authenticate user. Permanent fix PHP
GAPI hasn't been worked on since 2009. It also appears to use client
login which was discontinued / shutdown on April 20 2015. You can no
longer use client login with Google Analytics API, you need to switch
to Oauth2 or a service account. So either the author of that project
needs to fix his code, it appears to be an open source project so you
could probably fix it for him.
You have a couple of choices. Looks like the latest version of GAPI now has oauth support - see: https://github.com/erebusnz/gapi-google-analytics-php-interface or use the Google API PHP Client (https://github.com/google/google-api-php-client).
Version 2.0 on GitHub of the GAPI has been released which support OAuth2 authentication. Google has disabled all other forms of authentication.
Note that OAuth2 will require you to create a 'service account' and then download a P12 file to upload to the server. Finally you will need to adjust the developers console, enable 'analytics API'. Finally give this new user 'Read and Analyse' permissions on the Google Analytics accounts you want to access.