Pregunta

I released an app using the Google Mirror API. Now I am trying to set up a beta app at a new web address .info as opposed to .com. However with I authorize my app from the .info address I get redirected to the .com. I have triple checked the address in my code and my client ids and secrets. What could cause this? I am going to attach a screen shot of my API settings even though it looks like a top secret government document about aliens or something.

https://code.google.com/apis/console

This is where the client is called from.

 $client = new Google_Client();

  $client->setApplicationName($app_name);

  // These are set in config.php
  $client->setClientId($api_client_id);
  $client->setClientSecret($api_client_secret);
  $client->setDeveloperKey($api_simple_key);
  $client->setRedirectUri($base_url."/oauth2callback.php");

  $client->setScopes(array(
    'https://www.googleapis.com/auth/glass.timeline',
    'https://www.googleapis.com/auth/glass.location',
    'https://www.googleapis.com/auth/userinfo.profile'));

I know that the $base_url, $api_client_key and $api_client_secret are correct.

¿Fue útil?

Solución

Well I guess there was no way for someone to answer this question because it was unrelated to the code or Google APIs. The person who set up our web server had set Apache to rewrite https traffic to the .com address. It was hard to spot because there were duplicate files in both directories.

Otros consejos

Since you have both a .com and a .info redirect registered, you may want to make sure that the $api_client_id matches the one you're using for the .info and not the one you're using for the .com.

As a last resort - try deleting the entry for the .com ClientID.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top