0

我正在使用 hybridauth 来允许我的用户登录我的网站。我想知道当前用户正在使用哪个身份验证提供商(facebook、googel、..)。在这种情况下,我使用下面的脚本。但它没有获得身份验证提供程序。这该怎么做。给我一些提示?

<?php

session_start();

$config = dirname(__FILE__) . '/hybridauth/config.php';
require_once('hybridauth/Hybrid/Auth.php');

$ha = new Hybrid_Auth($config);

$t = $ha->authenticate('Facebook');

if ($t->isUserConnected()) {

    $profile = $t->getUserProfile();
?>

<html>
<body>
<pre><?php echo print_r ($profile); }?></pre>
</body>
</html> 
4

1 回答 1

4

您是否尝试过 Hybrid_Auth::getConnectedProviders()?

您还可以传入特定的提供程序以检查是否连接了特定的提供程序:Hybrid_Auth::isConnectedWith(provider)

查看API 文档以获取更多信息。

于 2013-11-13T21:39:41.863 回答