Все ведь правильно. Где ошибка? Выводит Ошибки авторизации! Код (Text): <?php $app_id = "xxx"; $app_secret = "xxx"; $my_url = "http://site.ru/c.php"; session_start(); $code = $_REQUEST["code"]; if(empty($code)) { $dialog_url = 'http://api.vk.com/oauth/authorize?client_id='.$app_id.'&scope=offline&redirect_uri='.$my_url.'&response_type=code'; echo("<script> top.location.href='" . $dialog_url . "'</script>"); } else { $token_url = 'https://api.vk.com/oauth/access_token?client_id='.$app_id.'&client_secret='.$app_secret.'&code='.$code.''; $params = json_decode(@file_get_contents($token_url)); print_r($params); $graph_url = 'https://api.vk.com/method/getProfiles?uid='.$params->user_id.'&access_token='.$params->access_token.'&fields=photo,nickname'; $user = json_decode(@file_get_contents($graph_url)); $userResponse = $user->response[0]; if ($userResponse->uid != '') { print_r($userResponse); echo ('Вы успешно авторизованны через вКонтакте'); } else echo('Ошибки авторизации!'); } ?>