Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angularfire2 custom authentication

I creating a website which has register link multiple auth providers and custom token as well. I also using AngularFire2 to communicate between Angular2 and Firebase but seem it doesn't have method similar with Firebase, e.g:

var ref = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com/"); ref.authWithCustomToken(AUTH_TOKEN, function(error, authData) {

Anyone can show up to me how can deal with issue?

like image 794
thanhtung90 Avatar asked Sep 14 '26 21:09

thanhtung90


1 Answers

To authenticate using a custom token, you can call AngularFire2's login method with the following configuration options:

angularFire.auth.login(AUTH_TOKEN, {
  provider: AuthProviders.Custom,
  method: AuthMethods.CustomToken
});

Internally, this will call Firebase's signInWithCustomToken method.

like image 130
cartant Avatar answered Sep 16 '26 11:09

cartant