我需要将我现有的chrome扩展连接到firebase。可能有人会建议一种新的方法吗?

时间:2016-07-08 09:42:43

标签: google-chrome-extension firebase firebase-authentication

我现有的应用程序使用:

$scope.signInGoogle = function(){
var ref = new Firebase(URL);
chrome.identity.getAuthToken({
    interactive: true
}, function(token) {
    localStorage.setItem("token",token);
    if (chrome.runtime.lastError) {
        alert(chrome.runtime.lastError.message);
        return;
    }

    // Authenticate with Google using an existing OAuth 2.0 access token
    ref.authWithOAuthToken("google", token, function(error, authData) {
      if (error) {
        console.log("Login Failed!", error);
      } else {
        console.log("Authenticated successfully with payload:", authData);
        $state.go("app.profile");
      }
    });
});};

需要知道如何使用Identity API登录firebase

0 个答案:

没有答案