I have a few webapps where I am using google login. When you are running the app in different domain then you will get error like
Error:redirect_uri_mismatch The redirect URI in request: http://mywebsite.com/ did not match registered redirect URI.
Also you might want to create new app for google oauth2 login. Anyway it is for some reason very difficult to find the correct url, I always tend to end up in google apps page.
Here is the secret link that solves all of your troubles