Похожие чаты

Hi, guys. I'm having some trouble with OAuth2.0 of Google. I'm

trying to get access spreadsheet on my hosting.
I'm following the guide:
https://github.com/googleapis/google-api-php-client

my php file is not redirecting to google auth page.
my code:
error_reporting(1);
// include your composer dependencies
require_once 'vendor/autoload.php';

$client = new Google_Client();
$client->setAuthConfig('client_secret.json');

$client->addScope(Google_Service_Drive::DRIVE_METADATA_READONLY);
$client->setRedirectUri('http://' . $_SERVER['HTTP_HOST'] . '/oauth2callback.php');
// offline access will give you both an access and refresh token so that
// your app can refresh the access token without user interaction.
$client->setAccessType('offline');
// Using "consent" ensures that your application always receives a refresh token.
// If you are not using offline access, you can omit this.
$client->setApprovalPrompt("consent");
$client->setIncludeGrantedScopes(true); // incremental auth
$auth_url = $client->createAuthUrl();

header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL));
what is wrong here?

1 ответов

3 просмотра
Murod-Parmonov Автор вопроса

https://developers.google.com/identity/protocols/OAuth2WebServer I have taken the example from here .

Похожие вопросы

Обсуждают сегодня

Типа вызывать GetParent и проверять на соответствие GetModuleHandle?
The Bird of Hermes
67
Do any of you guys have interesting projects one could join? I'm a Middle Full-Stack developer (JS/TS, React & Node)
Lev Shapiro
40
I read yesterday that in the near future most cryptos will be gone. It's like there is a lot of bullshit within the crypto sphere and this corruption some way is going to be c...
Kanah The Great
42
$res = json_decode($наша строка из респонса); $res1 = array_map(fn($o) => $o->name, $res->breadcrumbs[0]->entities); Как такое будет на Хаскеле?.. В начале весь джейсон, в ко...
Хаскель Моисеевич Гопник
27
Hello, I have a question. Can anyone help me? I want to make my cryptocurrencies, like Tron, untraceable by anyone, even government organizations. I was told that to do this,...
 ➛ Eᒪᕼᗩᗰ
14
В чем сила брат, в NASM или FASM?
Isaac Kleiner
18
Вопрос по диагностике ошибок (я знаю в чем, в данном конкретном примере, я знаю, как исправить, пример модельный, понятно, что в реальности бывает намного запутаннее). module...
ⰄⰎⰋⰐⰐⰑⰛⰤⰧⰧⰩⰄ ⰊⰑⰁⰓⰡⰛⰦⰕⰫ
11
Хтось використовував Vapor на Windows?
Jaroshevskii
15
It's notoriously hard to unit test video games, because they rely on user input so much and their output is audiovisual content. Does that mean video game code is never mainta...
Thomas
10
А чем вам питонисты не угодили?😂
.
79
Карта сайта