T
T
The-TS2020-08-17 22:53:40
Google
The-TS, 2020-08-17 22:53:40

Why redirect_uri_mismatch?

Hey,

I have code
<?php
  $params = array(
  'client_id'     => '782016323201-ktsn3pteacteii6958sr2u0f13fj4441.apps.googleusercontent.com',
  'redirect_uri'  => 'https://test-server.tsecret.net/AUTH-2/WithGoogle.php',
  'response_type' => 'code',
  'scope'         => 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile',
  'state'         => '001'
  );

  $url = 'http://accounts.google.com/o/oauth2/auth?' . urldecode(http_build_query($params));
  header('Location: '.$url.'');
?>

Why when it refers to the address https://test-server.tsecret.net/AUTH-2/WithGoogle.php google gives an error redirect_uri_mismatch, yes, I added this address to the Google API Console.
How to fix?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question