Created
June 30, 2016 22:07
-
-
Save katowulf/de9ef6b04552091864fb807092764224 to your computer and use it in GitHub Desktop.
Auth with Firebase 3.x and Cordova/Ionic using ngCordova oauth.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.$cordovaOauth.facebook("your_client_id", ["email"]) | |
.then(function (result) { | |
var credentials = firebase.auth.FacebookAuthProvider.credential(result.access_token); | |
return firebase.auth().signInWithCredential(credentials); | |
}) | |
.then(function (firebaseUser) { | |
console.log("Signed in as:", firebaseUser.uid); | |
}) | |
.catch(function (error) { | |
console.error("Authentication failed:", error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment