3

I'm using the Google signin Javascript API (that is, the gapi-signin-button) on a webapp. The app is served by a gulp server, binding to 0.0.0.0. The login process works when I develop locally, but when I run on a remote server and access the page via the public IP, I get the following signin error:

Error: invalid_request
Permission denied to generate login hint for target domain.

I have both localhost:PORT and SERVER_IP:PORT in my Authorized JavaScript origins. Other SO answers have said I should be binding to localhost instead of other interfaces, but that doesn't apply here since if I bind to localhost the server can't be accessed remotely. What do?

anand
  • 87
  • 2
  • 6
  • Have you figured out what causes this? I am having the same problem and have gotten no answers, as have you. This is driving me insane; I've even called Google and they just tell me to ask the question on Stack Overflow! – jimboweb Mar 19 '16 at 15:07
  • Does this answer your question? [Google: Permission denied to generate login hint for target domain NOT on localhost](https://stackoverflow.com/questions/36020374/google-permission-denied-to-generate-login-hint-for-target-domain-not-on-localh) – Dherik Mar 18 '20 at 20:27

1 Answers1

5

I had this same problem and just figured it out. You can't use numerical ip addresses (like http://0.0.0.0) as redirect uris in Google. It has to be an actual url, like http://mycompany.com.

jimboweb
  • 4,362
  • 3
  • 22
  • 45