【发布时间】:2016-05-13 18:08:16
【问题描述】:
引用Firebase Auth and Google Calendar,我该如何使用 Polymer 元素?
在我的页面上,我添加了一个 google-signin 元素
<google-signin
client-id="xxxx.apps.googleusercontent.com">
</google-signin>
然后我等待google-signin-success 事件被触发并通过
gapi.auth2.getAuthInstance().currentUser.get().hg.access_token)
如何使用 firebase-auth 登录?我尝试在我的页面中添加 firebase-auth 元素
<firebase-auth id="authenticate"
user="{{user}}"
location="{{location}}"
ref="{{refauth}}"
provider="google">
</firebase-auth>
并像这样以编程方式调用它
signIn: function() {
var params = {token: "ya29.xxxxx"};
this.$.authenticate.login(params);
},
signOut: function() {
this.$.authenticate.logout();
this.user = null;
}
});
但是,firebase-auth 仍然会弹出一个 google 登录对话框。如何使用访问令牌登录?
【问题讨论】:
标签: firebase polymer-1.0