Search
Other IP Login questions
Forum

Referring IP Address Option Not Working

robb rich's Avatar robb rich
Hi Peter,
I have installed the IP Login onto my documentation website and have created a User account that will be used for allowing access.

In the User setup I have configured the IP Login to use the Referring IP Address from the web application and I've selected Frontend for the usage.

Then I've taken the token from IP Login and added it to a link on the web application like this: https://linktodocumentation.com?mytoken

When I attempt to access that link from the web application it does go to the Joomla page, but fails to login. I've tested it with the Client-side option and my personal IP Address and it works as expected.

Any thoughts as to what I may have done incorrectly for the Referring option? I have tried disabling Akeeba AdminTools as well. But maybe it's a configuration on the server?

Thanks
Robb
Peter van Westen's Avatar Peter van Westen ADMIN
Then for some reason IP Login doesn't see the referring IP address as the same.

You could test what IP addresses PHP sees by creating a little PHP file with:
<?php print_r($_SERVER);
See what output you get when calling that file via the web app.
Please post a rating at the Joomla! Extensions Directory
robb rich's Avatar robb rich
Hi Peter,
Thank you for the reply. I have confirmed that the IP address I am using is the one Google displays as the public IP address, but it seems our Kubernetes cluster uses 4 different ranges that all resolve to the public IP.

I'm not able to put the PHP snippet you provided onto the application itself because it isn't a PHP program.

Is it possible with IP Login to do a combination list and range?

Thanks again for your time,
Robb
robb rich's Avatar robb rich
Hi Peter,
Thank you for the response. I did see that documentation about lists and ranges, but I wasn't sure if I could do a combination of both.

However, I was able to confirm the referring IP address by entering this into the index.php file and echoing the $ip
$urlParts = parse_url($_SERVER['HTTP_REFERER']);
$ip       = gethostbyname($urlParts['host']);

Do I need to make the link URL go to a specific page like destinationsite.com/login?[secretkey], or if I have the 'home' page set to be the User Login would the it work to just send them to destinationsite.com?[secretkey]?

Thanks
Robb
Peter van Westen's Avatar Peter van Westen ADMIN
$urlParts = parse_url($_SERVER['HTTP_REFERER']);
$ip       = gethostbyname($urlParts['host']);
You shouldn't use the gethostbyname.
See if the IP address is inside the $_SERVER object. And if so, under what key.
So do:
print_r($_SERVER);
Please post a rating at the Joomla! Extensions Directory
robb rich's Avatar robb rich
Hi Peter,
I really appreciate your help trying to figure this out. I ran the print_r($_SERVER); you suggested and found that there is no referring IP listed. I do see:

the correct referring URL
my client side IP address
the destination server IP address
the [secretkey]
the user associated with the secretkey

If I edit a link on Regular Labs in the console and point it to my destination site, I get the same result where it gives me the referring URL but nothing related to an IP address other than those mentioned above.

I wonder if there is a way to allow the login to happen by the referred URL or a list of referring URLs as opposed to the IP addresses?

Thanks
Robb
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
robb rich's Avatar robb rich
Hi Peter,
I really appreciate the work on a weekend. After updating the plugin, I am still unable to get it to work, and the print_r($_SERVER); snippet doesn't reveal any new IP information.

The last thing you probably want to do is continue to provide support for someone who was fortunate enough to purchase a lifetime license many years ago. I totally understand and I am willing to send some money for support. I know that continuous development takes time and appreciate the work you put into these incredibly useful plugins.

Let me know what I can do for continued support and I can send over the login details for the site.

Again, I am very grateful for your assistance, and I apologize for the problems.

Thanks
Robb
Peter van Westen's Avatar Peter van Westen ADMIN
Lifetime is lifetime, so it is what it is ?

I am not sure how I would be able to bugfix this without being able to see this in action myself.
But that would mean I would need access to whatever web application you are using to link to your website. And I would (s)FTP access to the website running IP Login itself... So I can see what is happening.
Please post a rating at the Joomla! Extensions Directory
robb rich's Avatar robb rich
Hi Peter,
I can definitely give you access (both FTP and Administrator) for the site where IP Login is installed. I may be able to get you a login for the application we are trying to link from, but I'm not sure if that would help since I am not able to get the referring IP to show up in the 'print_r($_SERVER)' report from any site that I try to link from.

Is it possible that my server is removing the referring IP Address or something with my Joomla installation? For a while I thought it may be Admin Tools, but I still had the problem after uninstalling it.

Do I send you the login and FTP information through the 'Confidential Information' button?

Thanks
Robb
robb rich's Avatar robb rich
Also, I've had the lifetime for over 7 years, and have gotten excellent service and products. I wouldn't mind purchasing the extension again just so you aren't doing this for free.

Having lifetime access to updates is one thing, but I have no problem with paying for support - especially after so long 🙂
Peter van Westen's Avatar Peter van Westen ADMIN
In the latest dev version I added code to get the IP based on the URL, if the value is not an IP address.
But seemingly that still doesn't work.
So yeah, I'd need to see what is going on.

If you want, I can of course cancel your Lifetime Bundle, so that you can purchase a normal Bundle subscription (or single extension subscription).
Please post a rating at the Joomla! Extensions Directory
robb rich's Avatar robb rich
Hi Peter,
Regarding the code to get the IP based on the URL - would I still enter in an IP address in the IP Login section of the User? Or would I leave it blank? Or was that code you added more for affecting the the results of print_r($_SERVER) output?

Thanks
Robb
Peter van Westen's Avatar Peter van Westen ADMIN
My changes don't affect the output of $_SERVER. $_SERVER is a fixed PHP object that cannot be changed.

The changes are for IP Login internally. That, when it grabs the value from the HTTP_REFERER, it will try to convert it to an IP address if it is not one.

I changed something in the new dev, so maybe it works for you now:
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
robb rich's Avatar robb rich
Hi Peter,
Sorry for the delay getting back to you.

I wanted to eliminate my server or the site settings as possibly being a reason for IP Login to not work as expected with the Referer IP.

There are two sites I built that are on two separate servers - though they are with the same hosting provider (Liquid Web). One is a Joomla site and the other is an Opencart site.

I installed the most recent dev version of IP Login onto the Joomla site and created a user account that had the IP address from the Opencart site. I went to the Opencart site and set a link with the secret key and tested it out, and I was still not able to get the connection to login to the Joomla site. I added the print_r($_SERVER) script to the Joomla site and it showed the correct referring URL, but there wasn't anything regarding the IP address (other than my Client IP, and the Remote IP.

Thanks
Robb
robb rich's Avatar robb rich
Hi Peter,
I had another thought that maybe I could get it to work from another site on the same server that uses the same IP address. But that was unsuccessful as well.

Another thing I tried was the extension from www.digigreg.com/en/wiki/digi-get-login.html that passes the username and password in a query. The query showed in the destination site in the URL bar of the browser just like it does with IP Login, but also failed to pass into the login form.

I've asked my hosting provider - Liquid Web - if there is something with either with the server security package I have with them, or if there is something in the server firewall that would be causing the issue.

Thanks
Robb
Peter van Westen's Avatar Peter van Westen ADMIN
I am not sure how I would be able to bugfix this without being able to see this in action myself.
But that would mean I would need access to whatever web application you are using to link to your website. And I would (s)FTP access to the website running IP Login itself... So I can see what is happening.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription