只有Facebook的身份验证 [英] Facebook authentication only

查看:117
本文介绍了只有Facebook的身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Facebook的工作登录我讨论网络上。我终于想通了怎么办OAuth授权。但我真的不希望有关用户的信息外,我不需要他们,我不知道为什么我应该问他们。所有我需要的是认证(用户ID)。

I'm working on login to discussion on my web using facebook. I finally figured out how to do oauth authorization. But I really don't want extra informations about user, I don't need them and I don't know why should I ask for them. All I need is authentication (user id).

什么是做到这一点的最好方法是什么?

What's the best way to do this?

推荐答案

您已经被授予的基本权限来获取用户的ID。这是一个用户可以授予您许可的最低金额。

You have to be granted basic permissions to get the user's id. This is the minimum amount of permission that a user can grant to you.

您说您已经想通了的OAuth - 您使用什么方法/语言?如果它的JS,那么你只需要这样的:

You said you have figured out oauth - what method/language are you using? If its JS then you just need this:

 FB.login(function(response) {
   if (response.authResponse) {
     console.log('Welcome!');
   } else {
     console.log('User cancelled login or did not fully authorize.');
   }
 });

这篇关于只有Facebook的身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆