Search code examples
virtual-machinefacebook-loginfacebook-oauth

Facebook app, OAuth redirect to local virtual machine


I've got a virtual machine running on ESXI which I use for local development, I access this machine in my browser via a local domain, http://dev for example. This all works well and no issue for years until I've just started using Facebook Login which requires OAuth redirect URLs to be 'real'.

I can no longer use my http://dev as it won't allow it, I noticed it will however allow http://localhost.

I should note I'm not always using apache/nginx etc so I don't want to be creating virtual hosts

How do I go about being able to register a virtual machine for a OAuth redirect when it's not accessible on localhost?


Solution

  • Despite being sure I've tried this before, I did just try the local IP address of the server (192.168.0.111) and looks like that worked for the redirect/callback on the Facebook Developers Console.

    So, while not ideal, you can use the local IP rather than the hostname.