jaredhanson / passport-google-oauth

Google authentication strategies for Passport and Node.js.
https://www.passportjs.org/packages/passport-google-oauth/?utm_source=github&utm_medium=referral&utm_campaign=passport-google-oauth&utm_content=about
MIT License
776 stars 327 forks source link

oauth2 example fails with a local test server #38

Open chmorgan opened 10 years ago

chmorgan commented 10 years ago

Set express back to 3.x to get things working, updated the url like:

plugged in my client and secret values, and google is reporting an error:

"

  1. That’s an error.

Error: invalid_request

device_id and device_name are required for private IP: http://192.168.1.10:3000/auth/google/callback

Learn more

Request Details That’s all we know. "

JC1DA commented 10 years ago

I have same problem too. Hope this will be fix soon

alexis-gruet-deel commented 10 years ago

I solved this issue by replacing the private/local IP in the GoogleConsole by a faked fqdn ( blahblah.com ), then edit the local /etc/hosts file by pointing the private IP to the new fqdn.

if you are working w/ a VM, please note that you'll have to edit /etc/hosts file on both guest and vm

chaitanyavenni commented 10 years ago

I have same problem - device_id and device_name are required for private IP: http://10.230.59.77:8080/system/log-in/ How to resolve this issue

alexis-gruet-deel commented 10 years ago

Go thru the google cloud console and change the callback IP by a domain like http://myhost.com/oauth/google/callback ( this is just a example )

then edit your local /etc/hosts to match 10.230.59.77 with myhost.com and it will rocks

if your are working on a virtual machine edit also the /etc/hosts of your vm to match 10.230.59.77 w/ myhost.com. Both need to be set

debashish-ghosh commented 8 years ago

I cannot use the hosts solution because there are about 20 different systems which will be using the site.

aagam29 commented 5 years ago

I'm working with a container , facing the same issue

matteoopenf commented 5 years ago

found a solution?

aagam29 commented 5 years ago

Yes. Change ip with domain name. And add it in google cloud console

matteoopenf commented 5 years ago

many thanks

subgero commented 4 years ago

Yes. Change ip with domain name. And add it in google cloud console

Could you elaborate the solution please.

Tananga commented 2 years ago

xD This issue is from 2014 and still not solved. Im using my phone as a device so I cant change /etc/hosts

huyprowow commented 6 months ago

could you try this: https://stackoverflow.com/questions/24736168/error-invalid-request-device-id-and-device-name-are-required-for-private-ip