0

I am trying to test my Ruby on Rails application authenticating using OAuth2.0 against a Google API, specifically Map Tracks. In my Google Developers Console, I have to specify my redirect URL and it is specified as the following: http://ec2-54-68-164-136.us-west-2.compute.amazonaws.com/:3000/auth/google_oauth2/callback. My issue is that when I click to authenticate with Google, it shows the following error screen:

https://i.stack.imgur.com/JHwv1.png

So basically it seems that the Google API Client or Oauth server automatically quantifies my Public DNS as an IP address and I'm not sure how to get this working correctly. If it matters, my server that is being hosted has an Elastic IP Address so that the IP isn't constantly changing.

Thanks for any help!

1 Answers1

0

The callback URL you specified in your question contains an extra / before the :3000 that you should remove.

That being said, I have this setup working for an app hosted on EC2 instances (https://identity-demo.aws-emea.info) The differences I can see between your setup and mine are

  • https vs. http
  • I am using an alias with my own domain name instead of the EC2 DNS name

I would advise against using the EC2 provided DNS name as this is subject to change when you will stop / start your instance (with default public IP addresses) or when you will associate a different EIP (Elastic IP Address)

Sébastien Stormacq
  • 14,301
  • 5
  • 41
  • 64
  • Thank you for the help. I just bought a domain name from GoDaddy and I wanted to make sure that I'm applying the alias correctly. Would giving the IP address an alias be considered Forwarding or a Hostname? – Garreth Nedved Dec 06 '14 at 03:19
  • I am not sure I understand your question – Sébastien Stormacq Dec 06 '14 at 08:56
  • Sorry for the confusion. I bought a domain, and I'm not sure how to get it set up so that when someone is trying to access my domain, that it sends then to my amazon ec2 instance. My domain name is teamtracker.info,and my ec2 instance DNS name is http://ec2-54-68-164-136.us-west-2.compute.amazonaws.com – Garreth Nedved Dec 06 '14 at 23:25
  • Nevermind, sorry for the unclear question. I ended up figuring it out! Thanks again! – Garreth Nedved Dec 06 '14 at 23:47