HybridAuth working within local network, but not when accessed outside of my network

592 Views Asked by At

I've set up HybridAuth on my webserver. I have a basic html page that displays 3 log in options for either Google, Facebook, or Twitter. For testing on my home pc, I set the config.php file to read:

"base_url" => "http://my.local.ip.address/hybridauth-2.1.2/hybridauth/index.php",

So far, with this set up, selecting the Sign in with Twitter option does work and I can grab some basic profile info from the user. However, Facebook returns the following message:

  • Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.

When trying Google it returns this:

-Invalid parameter value for redirect_uri: Raw IP addresses not allowed: http://my.local.ip.address/hybridauth-2.1.2/hybridauth/?hauth.done=Google

As a note for above, "my.local.ip.address" was my actual local ip address but I was forced to change it here. However, when I change the config.php to have what it should for normal use:

"base_url" => "http://myFQDN.com/hybridauth-2.1.2/hybridauth/index.php",

then I get on my phone (not on my local network) and it just reloads the base html page, no matter what option I select.

Any help or suggestions would be great.

Note: Port 80 is blocked from my ISP, thus so, I have it redirecting from my registrar to another port that is then forwarded inside my router. If it's possible this is the issue, please let me know as well. - Additionally, everything works fine when I'm just putting up a standard .html pages.

Thanks

1

There are 1 best solutions below

0
On

I don't think that most of the OAuth2 providers will accept answers that are not coming from configured callback url. So making redirects with the register will most likely fail.

Instead, try to configure your callback to look like: http://www.yourdomain.com:openPort/hybridauth-2.1.2/hybridauth/index.php

Where openPort is a port number that your ISP will not block. Then in the router you can make port forwarding openPort->80 or you just can start your web server to openPort and make sure the router is not blocking the requests.