ошибка при настройки авторизации через социальные сети
1) Fatal error: Call to undefined function hash_hmac() in /home/agama-auto/sunriselite.ru/docs/wa-system/auth/adapters/twitterAuth.class.php on line 118
2) Warning: file_get_contents() [function.file-get-contents]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /home/agama-auto/sunriselite.ru/docs/wa-system/auth/waAuthAdapter.class.php on line 68
Warning: file_get_contents(https://oauth.vk.com/token?client_id=4354676&code=2bd6b47cb141882370&client_secret=NoKYfbtcHHNy2AiFdLTo&redirect_uri=http%3A%2F%2Fsunriselite.ru%2Foauth.php%3Fprovider%3Dvkontakte) [function.file-get-contents]: failed to open stream: No such file or directory in /home/agama-auto/sunriselite.ru/docs/wa-system/auth/waAuthAdapter.class.php on line 68
Can't get access token from VK
Error with code 500 in '/home/agama-auto/sunriselite.ru/docs/wa-system/auth/adapters/vkontakteAuth.class.php' around line 36:
31 {
32 $url = self::OAUTH_URL."token?client_id=".$this->app_id."&code=".$code."&client_secret=".$this->app_secret."&redirect_uri=".urlencode($this->getCallbackUrl());
33 $response = $this->get($url, $status);
34 if (!$response) {
35 waLog::log($this->getId(). ':'. $status. ': '."Can't get access token from VK", 'auth.log');
>>36 throw new waException("Can't get access token from VK", $status ? $status : 500);
37 }
38 $response = json_decode($response, true);
39 if (isset($response['error']) && !isset($response['access_token'])) {
40 waLog::log($this->getId(). ':'. $status. ': '.$response['error']." (".$response['error_description'].')', 'auth.log');
41 throw new waException($response['error']." (".$response['error_description'].')', $status ? $status : 500);
Call stack
#0 /home/agama-auto/sunriselite.ru/docs/wa-system/auth/waOAuth2Adapter.class.php(40): vkontakteAuth->getAccessToken('2bd6b47cb141882...')
#1 /home/agama-auto/sunriselite.ru/docs/wa-system/controller/waOAuthController.class.php(20): waOAuth2Adapter->auth()
#2 /home/agama-auto/sunriselite.ru/docs/wa-system/controller/waController.class.php(21): waOAuthController->execute()
#3 /home/agama-auto/sunriselite.ru/docs/wa-system/controller/waViewController.class.php(46): waController->run(NULL)
#4 /home/agama-auto/sunriselite.ru/docs/wa-system/controller/waFrontController.class.php(125): waViewController->run()
#5 /home/agama-auto/sunriselite.ru/docs/wa-system/waSystem.class.php(404): waFrontController->execute(NULL, 'OAuth')
#6 /home/agama-auto/sunriselite.ru/docs/index.php(7): waSystem->dispatch()
#7 {main}
Request
array (
'provider' => 'vkontakte',
'code' => '2bd6b47cb141882370',
'_csrf' => '536d1d9dccc462.94229237',
'last_page' => '3^^^/webasyst/checklists/',
'PHPSESSID' => '5e26c8fce5ca44c56940f1b19d203c0b',
'shop_lastview' => '77',
)
Params
array (
)
Выдает ошибки, хотя настроено все правильно.
2) Warning: file_get_contents() [function.file-get-contents]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /home/agama-auto/sunriselite.ru/docs/wa-system/auth/waAuthAdapter.class.php on line 68
Warning: file_get_contents(https://oauth.vk.com/token?client_id=4354676&code=2bd6b47cb141882370&client_secret=NoKYfbtcHHNy2AiFdLTo&redirect_uri=http%3A%2F%2Fsunriselite.ru%2Foauth.php%3Fprovider%3Dvkontakte) [function.file-get-contents]: failed to open stream: No such file or directory in /home/agama-auto/sunriselite.ru/docs/wa-system/auth/waAuthAdapter.class.php on line 68
Can't get access token from VK
Error with code 500 in '/home/agama-auto/sunriselite.ru/docs/wa-system/auth/adapters/vkontakteAuth.class.php' around line 36:
31 {
32 $url = self::OAUTH_URL."token?client_id=".$this->app_id."&code=".$code."&client_secret=".$this->app_secret."&redirect_uri=".urlencode($this->getCallbackUrl());
33 $response = $this->get($url, $status);
34 if (!$response) {
35 waLog::log($this->getId(). ':'. $status. ': '."Can't get access token from VK", 'auth.log');
>>36 throw new waException("Can't get access token from VK", $status ? $status : 500);
37 }
38 $response = json_decode($response, true);
39 if (isset($response['error']) && !isset($response['access_token'])) {
40 waLog::log($this->getId(). ':'. $status. ': '.$response['error']." (".$response['error_description'].')', 'auth.log');
41 throw new waException($response['error']." (".$response['error_description'].')', $status ? $status : 500);
Call stack
#0 /home/agama-auto/sunriselite.ru/docs/wa-system/auth/waOAuth2Adapter.class.php(40): vkontakteAuth->getAccessToken('2bd6b47cb141882...')
#1 /home/agama-auto/sunriselite.ru/docs/wa-system/controller/waOAuthController.class.php(20): waOAuth2Adapter->auth()
#2 /home/agama-auto/sunriselite.ru/docs/wa-system/controller/waController.class.php(21): waOAuthController->execute()
#3 /home/agama-auto/sunriselite.ru/docs/wa-system/controller/waViewController.class.php(46): waController->run(NULL)
#4 /home/agama-auto/sunriselite.ru/docs/wa-system/controller/waFrontController.class.php(125): waViewController->run()
#5 /home/agama-auto/sunriselite.ru/docs/wa-system/waSystem.class.php(404): waFrontController->execute(NULL, 'OAuth')
#6 /home/agama-auto/sunriselite.ru/docs/index.php(7): waSystem->dispatch()
#7 {main}
Request
array (
'provider' => 'vkontakte',
'code' => '2bd6b47cb141882370',
'_csrf' => '536d1d9dccc462.94229237',
'last_page' => '3^^^/webasyst/checklists/',
'PHPSESSID' => '5e26c8fce5ca44c56940f1b19d203c0b',
'shop_lastview' => '77',
)
Params
array (
)
Выдает ошибки, хотя настроено все правильно.
1 ответ
1. Почему недоступна стандартная функция hash_hmac: http://ru2.php.net/manual/ru/function.hash-hmac.php
2. Почему запрещён доступ к ресурсам по https с помощью функции file_get_contents. Возможно, отсутствует расширение OpenSSL (см. в необязательных требованиях к установке фреймворка Webasyst: http://www.webasyst.ru/developers/docs/installation/).