Php HybridAuth-在身份验证期间处理过期的提供程序令牌

Php HybridAuth-在身份验证期间处理过期的提供程序令牌,php,exception-handling,oauth,single-sign-on,hybridauth,Php,Exception Handling,Oauth,Single Sign On,Hybridauth,正如许多人指出的那样,HybridAuth文档非常缺乏,因此我很难找到在尝试身份验证序列期间处理过期令牌的正确方法。我的代码当前为: try { $provider = /* Provider Object in our system */ // Initialize HybridAuth $client = new Hybrid_Auth($provider->get_config()); // try to authenticate with th

正如许多人指出的那样,HybridAuth文档非常缺乏,因此我很难找到在尝试身份验证序列期间处理过期令牌的正确方法。我的代码当前为:

try {

    $provider = /* Provider Object in our system */

    // Initialize HybridAuth
    $client = new Hybrid_Auth($provider->get_config());

    // try to authenticate with the selected provider
    $adapter = $client->authenticate( $provider->name );

    // then grab the user profile
    /* @var $user_profile Hybrid_User_Profile */
    $user_profile = $adapter->getUserProfile();

} catch( Exception $e ) {

    $user_profile = NULL;
    $adapter->logout();

}
如果会话由于任何原因在我们端仍然处于活动状态,但令牌在提供程序处已过期,则行$user\u profile=$adapter->getUserProfile;就在catch之前,抛出了一个异常,这是预期的,尽管错误消息缺少一些非常重要的信息,并且有些误导

我能够在另一个线程中找到,很抱歉我找不到,如果您知道一个示例,我需要指示HybridAuth使用$adapter->logout忘记令牌信息,请随时编辑链接;方法

那现在呢?我应该重定向吗?如果是,地址是什么?这里的最佳实践是什么

如有任何见解,将不胜感激