Firebase 3 - 其他验证范围数据 [英] Firebase 3 - Additional Auth Scope Data
问题描述
$ b
可选:指定额外的OAuth 2.0您希望从身份验证提供程序请求的范围。要添加范围,请调用addScope。例如:
provider.addScope('https://www.googleapis.com/auth/plus.login');
一旦验证,我无法找到数据作为用户对象的一部分。任何想法如何挑选额外的数据?
谢谢
以Github为例,只有当用户的电子邮件地址在github上设置为public时,才能够检索用户的电子邮件地址。当电子邮件地址设置为私人时,传递用户:电子邮件
作用域不起作用。例如
provider = new firebase.auth.GithubAuthProvider();
provider.addScope('user:email');
In the Firebase 3 documentation, they say you can grab additional scope data such as this one:
Optional: Specify additional OAuth 2.0 scopes that you want to request from the authentication provider. To add a scope, call addScope. For example:
provider.addScope('https://www.googleapis.com/auth/plus.login');
Once authenicated, I can't find the data as part of the "user" object. Any idea how to pick that extra data ?
Thank you,
I have tested this out and using Github as an example, was able to retrieve the user's email address only if the user's email address was set to public on github. Passing the user:email
scope had not effect when the email address was set to private. e.g.
provider = new firebase.auth.GithubAuthProvider();
provider.addScope('user:email');
这篇关于Firebase 3 - 其他验证范围数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!