Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query by IP #70

Closed
ghost opened this issue Aug 19, 2016 · 4 comments
Closed

Query by IP #70

ghost opened this issue Aug 19, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Aug 19, 2016

In order to query the API we use user/pass or API key. Is there any possibility to have an optional item to also query by API key plus IP address?

@ghost
Copy link
Author

ghost commented Aug 19, 2016

... so only that/those IP address(es) along with API key get valid data returned.

@ghost
Copy link
Author

ghost commented Aug 19, 2016

.. actually thinking about this again. Also would it be possible to also query by user/pass plus IP address(es) too?

@bato3
Copy link

bato3 commented Sep 29, 2016

My guess is that you want to protect, to work with the IP specific API key.

If so, add the line:
if ($_SERVER [ "REMOTE_ADDR"] == '192.168.0.1')
before
$restAPI = new RestAPI('API_KEY_FOR_192.168.0.1');

@ghost
Copy link
Author

ghost commented Sep 29, 2016

Hi Bato,
I don't do PHP but that has resolved my potential MIM attack on my none-SSL site. Now using, if ($_SERVER [ "REMOTE_ADDR"] == '192.168.0.1' || $_SERVER [ "REMOTE_ADDR"] == '192.168.0.2') for multiple allowed IP's.

Thanks 👍

@ghost ghost closed this as completed Oct 10, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant