1

I'm trying to get Google Login to work für a web application. Though similar questions have been asked no answer to those could help me.

The infrastructure is currently as follows:

  • DNS handled by an external service routing the main domain to an Elastic-IP
  • AWS-EC2 instance running Apache2 as a load balancer for spring-boot-services and serving web-contant linked to the Elastic-IP
  • Several other EC2-instances running spring-boot-services

One of those instances is running the service that is responsible for handling the Google-Login, which is completely handled by Spring. I configured the service combining some tutorials found in the net. I am able to contact it and I get redirected to Google, but that's where it ends. I get the following error:

Error 400: invalid_request device_id and device_name are required for private IP: http://10.0.0.196:8084/login/oauth2/code/google

But nowhere in the Google-documentation I can find "device_id" or "device_name". I have no idea how to handle that. Maybe I could trick my server to send the requests posing as the official domain, but I don't know how to do that either.

Does anybody know the best practice how to handle that?

Fencer
  • 1,026
  • 11
  • 27
  • Did you check https://stackoverflow.com/questions/24736168/error-invalid-request-device-id-and-device-name-are-required-for-private-ip and https://stackoverflow.com/questions/27045616/google-oauth-device-id-and-device-name-are-required-for-private-ip ? – Nagaraj Tantri Apr 19 '21 at 08:25
  • Yes, those are completely different cases. I'm not on my local machine, so the issue is not to trick my PC into contacting itself via a (Fake-)Domain – Fencer Apr 19 '21 at 20:08
  • Could you provide more details on the config of the callback? You mentioned that _I get redirected to Google_ , so do you get a proper google login page and then when you click login, you get this error? – Nagaraj Tantri Apr 20 '21 at 04:34
  • I am using spring-boot and spring-security to handle the login, so I do not config the callbak myself. I rely on Spring to handle that part correctly. The rediredt is triggered somewhere inside spring-security. Basically you just hand over the client-ID and the secret and let it do its magic. – Fencer Apr 20 '21 at 05:51

0 Answers0