【发布时间】:2014-02-03 12:08:30
【问题描述】:
我有一个非常基本的 PHP 站点,我想使用他们提供的示例(以下是我的版本)对 Google Apps 使用 oauth2 身份验证,不断提示用户进行身份验证以允许我的应用离线访问他们的帐户,我不想要。
$this->gapps_api_client = new Google_Client();
// $this->gapps_api_client->setAccessType('online');
$this->gapps_api_client->setApplicationName( GAPPS_APPLICATION_NAME );
$this->gapps_api_client->setClientId( GAPPS_CLIENT_ID );
$this->gapps_api_client->setClientSecret( GAPPS_CLIENT_SECRET );
$this->gapps_api_client->setRedirectUri( GAPPS_REDIRECT_URI );
$this->oauth2 = new Google_Oauth2Service($this->gapps_api_client);
我一直在玩“setAccessType”,但没有值似乎对这种离线权限模式有影响。 我尝试将其注释掉,将其设置为“在线”、“离线”,没有任何区别。
在没有用户授予您的应用“离线访问”权限的情况下,还有其他人能够进行 oauth2 身份验证吗?
【问题讨论】: