Facebook用户登录:没有应用程序授权的用户验证 [英] Facebook user login: user authentication without app authorization

查看:147
本文介绍了Facebook用户登录:没有应用程序授权的用户验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Facebook登录有问题。目前我正在使用登录网址(getLoginUrl($ params = array())),它自动处理用户身份验证和应用验证/授权。

I have a problem with the Facebook login. Currently I'm using login url (getLoginUrl( $params=array())), which automatically takes care of the user authentication and app authentication / authorization.

,当新用户打开应用程序时,FB会自动将他重定向到认证页面。

This means, that when the new user opens application, FB automatically redirects him to the authentication page.

在这种情况下,我宁愿收到该用户尚未认证的信息我的应用程序这将让我有机会向新用户显示有关应用程序的一些其他信息,然后才能面对FB身份验证页面。

In such cases, I would rather receive information, that this user has not yet authenticated my app. This would give me a chance to show new users some additional information about the app, before they face the FB authentication page.

我想我正在寻找一个功能,这将返回,当前用户是否已经验证了我的应用程序。

I guess that I'm looking for a function, which would return, whether the current user has already authenticated my app or not.

有没有办法检索FB的这种信息?

Is there a way to retrieve this kind of information form FB?

推荐答案

您目前是否使用header()或某些东西自动重定向?这样可能有帮助?

Are you currently redirecting automatically with header() or something? Something like this maybe helps?

$user = $facebook->getUser();
if ($user) {
  //stuff when user authenticated
} else {
  //stuff when user is not authenticated
  ?>
  <a href="<?php echo $facebook->getLoginUrl(array()); ?>">authenticate</a>
  <?php
}

还赞成这种方法 - 我认为在向用户显示您的应用程序承诺之前,不要自动重定向更为用户友好。也许我的演示应用程序也有帮助吗? http://eagerfish.eu/example- Facebook-iframe-app-using-graph-api-through-php-sdk /

Also thumbs up whit this approach- I think it's more user friendlier to not redirect automatically before showing user what your app promises. Maybe my demo app helps also? http://eagerfish.eu/example-facebook-iframe-app-using-graph-api-through-php-sdk/

这篇关于Facebook用户登录:没有应用程序授权的用户验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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