Google OAuth2 not working on local development server - PHP Codeigniter spark
I got around this by adding a hosts file record for the domain with the dev part at the front rather than the end (which I usually do too):
/etc/hosts
127.0.0.1 localhost.mydomain.com
/etc/apache vhost
ServerName mydomain.com.localhostServerAlias localhost.mydomain.com
Then tell google to use:
http://localhost.mydomain.com/index.php/oauth2/session/google
When you create client ID for web applications in Google APIs Console you can add allowed Redirect URIs
. It accepts localhost
urls and others as well.