0
我試圖通過Box-Api設置授權過程。第一步必須是一個GET調用授權URL,它具有攜帶三個參數:Web服務Oath2 zend框架1.12
- REDIRECT_URL
- CLIENT_ID
- RESPONSE_TYPE =代碼
這是我的示例代碼這個電話:
class OauthController extends Zend_Controller_Action
{
public function indexAction()
{
$client = new Zend_Http_Client('https://www.box.com/api/oauth2/authorize');
$client->setMethod(Zend_Http_Client::GET);
$client->setParameterGet(array(
'response_type' => 'code',
'client_id' => 'xxxxxxxxxxxxxxxxxx',
'redirect_uri' => 'http://localhost/imball-reagens/callback'
));
$response = $client->request();
$this->_helper->viewRenderer->setNoRender(true);
return $response;
}
}
我已經在我的網站的主頁鏈接到這個控制器,我已經採取遠離視圖,因此Controller只能執行http呼叫。它應該用Box.com的登錄提醒用戶,但它不會,而是隻顯示一個白頁。 Zend服務器拋出當我把這個控制器警告:
Slow Request Execution
Request to http://localhost:10088/imball-reagens/public/oauth took 3042ms