I have a virtual localhost (http://server.ehc.localhost) and I want to use the Google oauth in PHP.
In console (https://console.developers.google.com)
APIs&auth->credentials->myproject->credentials:
http://server.easyhomecosts.localhost:8081
http://server.easyhomecosts.localhost
I have always get the same error.
Authorized redirect URIs
Must have a protocol. Cannot contain URL fragments or relative paths. Cannot be a public IP address.
this is my code in php file
$client = new Google_Client();
$client->setClientId(CLIENTID);
$client->setClientSecret(CLIENTSECRET);
$client->setRedirectUri('http://server.easyhomecosts.localhost:8081');
$client->addScope("email");
$client->addScope("profile");
$service = new Google_Service_Oauth2($client);
$authUrl = $client->createAuthUrl();
echo '';
I click on the link and I have always:
error: invalid_request Invalid parameter value for redirect_uri: Non-public domains not allowed: http://server.easyhomecosts.localhost:8081
Is it possible to use my localhost server?
0 comments:
Post a Comment