我已经与laravel集成了hybridauth,并且能够使用hybridauth通过twitter登录到我的应用程序。当我第一次使用twitter登录我的应用程序时,我已经授权我的应用程序。所以,通常在下次我不需要授权我的应用程序登录因为我已经接受授权的第一次。需要每次授权应用程序 - hybridauth laravel localhost
但它没有发生。每当我尝试登录Twitter时,我的应用程序都迫使通过Twitter进行授权。
我想在本地主机上。我应该在活服务器上检查它吗?
我使用这个代码,所有凭证都设置好的:
Route::get('social/{action?}', array("as" => "hybridauth", function($action = "")
{
// check URL segment
if ($action == "auth") {
// process authentication
try {
Hybrid_Endpoint::process();
}
catch (Exception $e) {
// redirect back to http://URL/social/
return Redirect::route('hybridauth');
}
return;
}
try {
// create a HybridAuth object
$socialAuth = new Hybrid_Auth(app_path() . '/config/hybridauth.php');
// authenticate with Google
$provider = $socialAuth->authenticate("Twitter");
// fetch user profile
$userProfile = $provider->getUserProfile();
}
catch(Exception $e) {
// exception codes can be found on HybBridAuth's web site
return $e->getMessage();
}
// access user profile data
echo "Connected with: <b>{$provider->id}</b><br />";
echo "As: <b>{$userProfile->displayName}</b><br />";
echo "<pre>" . print_r($userProfile, true) . "</pre><br />";
// logout
$provider->logout();
}));