Is it possible to use the facebook API on XAMPP (local server)? - php

Is it possible to use the facebook api like we do it on sites live on the internet , but on XAMPP ( a local server) installed on my computer ? I'd really appreciate your feedback.

Mostly the API's should work fine unless you have a registered domain associated with the API app key.
You have not specified which API you are using [Facebook has a lot of API's with various security levels]
A few disadvantages on working on local machines are as follows
A local machine is identified as an anonymous request coming from some IP as its not associated with a domain. Therefore chances of blocking your API request are high.
Your system may have imposed firewall rules for incoming and outgoing requests, if your local server is not configured to send and receive outbound requests your might be in trouble.
Hope this helps.

This is sent from a mobile, don't ask me how but the comment system doesn't work nicely for me.
A local server is the same as a live website, the only difference is that you run it locally...
If you have an internet connection while running the server, you're basicly the same as every other server....
but well if you don't have internet on it don't expect it to be working....
[but ofcourse you can only connect to it locally and not from other computers xD]
I hope I answered your question now, Feel free to add a comment if you want to.
Yours sincerely,
Mike M.

Yes you can. Just make sure that redirect url must be the url which we put in the facebook while building the app.

Related

How can I use my php webapp to interact with an API on localhost?

I've written a webapp in php, which works as a standalone app, but needs to get/post new data from time to time to an API (written by a different company, for desktop software) on localhost. When connecting, it would be from a webpage/browser open on that machine.
So far I've attempted to send curl requests, basically using the generated postman curl code, and it's returning false. I'm thinking it's because it can't connect to the localhost server, possibly because it's blocked from the internet.
I've been researching for a few days, but want a solution that doesn't involve me creating security vulnerabilities in the computers I am trying to connect to, by opening them directly to the internet, and if there is a way to send requests to localhost without installing more software on them I would be partial to that kind of setup.
Does this make sense? I hope someone has some experience or wisdom in this area that could at least nudge me in the right direction.
The localhost is always the computer where you refer to that host. You can't connect to the localhost from your webapp, because the localhost hostname for that app is the computer which runs it.
You have to open a tunnel from you computer to the internet where you webapp can communicate with it.
You can use ngrok to do that, for example

Choices regarding IP restrictions on web request

Didn't really know what title to give this question so I hope its acceptable.
I am using a system which has an API. I don't have a lot of control over this system, but one thing I need for security reasons is for it to be locked down to my IP. This works, so now the system can only be accessed from my IP.
Now, I have built a custom app which uses the above API. This app is hosted on a server which is different from my IP address. Therefore, when I try to make the API call it fails due to it being restricted. I know this is the case, because if I run the app locally from my location, it works without any problems.
So, the question is whats the best thing to do? I know I could add the IP address of the server which is hosting my app to the systems API. However, I think the servers IP is dynamic which could cause problems. I have also used things like no-ip locally to control my dynamic IP, but I cant imagine I can install this on my web server.
Looking for thoughts as to how I can overcome this problem.
Thanks

IP address is blacklisted after ajax post testing

I have been working on a cross-platform mobile application using Phonegap. I am storing/receiving user’s/other’s location every 10 (ten) seconds using jQuery, Ajax, POST, PHP, phpMySql. I have been testing this exhaustively on my computer, Android and iOS devices.
Suddenly it stopped working. When I checked the location/website where files/database are hosted, it’s showing ‘Access denied. Your IP address [XXX.XXX.XX.XX] is blacklisted. If you feel this is in error please contact your hosting providers abuse department.’. My website is hosted on JustHost. There is no IP address added in IP Deny Manager.
So, it was working on my phone (or other devices) on Mobile data but not on Wi-Fi.
After some times it started working normally. What could be reason for this? This gives me scary thoughts. What if app user’s IP address also get blacklisted? Why did it happen? Have I done some thing wrong? Or is it due to some other reasons?
The server may think that this dDos attack.
In addition, a large number of post requests very heavy load server.
You can use websocket protocol and nodejs. This is the best solution. For example see the socket.io library (http://socket.io/).

How to setup a local server which can accept oAuth callbacks?

I am not sure if this question has a place over here but I am having a lot of trouble setting up a local development server from where I can work on Facebook, Twitter, Google+ and other applications.
As of now I have an Apache environment and I am working on a PHP based platform. The database server is a standard MySQL server. Also, I am working behind a authentication based proxy.
The primary issue that I encounter is, when I made an application on Twitter and entered the relevant details like - website, callbackurl as 127.0.0.1. My application when tried to retrieve the oAuth key, it wasn't able to. I even tried out changing my listening post to something other than 80, but it didn't work either.
I understand that any application of this sort will encounter this problem because 127.0.0.1 is not an address that points to my computer precisely. And I am not aware of any other method other than this. Am I doing something wrong somewhere or is it impossible to develop/test applications which require oAuth via a locally deployed server.
Update
Port forwarding is not a solution because I am behind a firewall and I am part of a private network. Hence, my questions are-
Is this kind of development impossible in such a setup? If yes, then what can I do to? If I work using a dongle, will it possible? Or do I need to procure a static IP?

need to create an application that will work on the Internet also and local internet also

i need to make a website such that it can be accessed through the internet if internet is available otherwise when there is no internet then it should work properly on the local intranet also can this be achieved , i have built my site on php/mysql
if this can be achieved please tell me and direct me to some examples of how to achieve this
thankyou
Google Gears?
http://gears.google.com/support/
If you have a local web server, why not just host everything from there instead of hosting it elsewhere, and set it up so incoming connections from the outside hit that machine as well.
Or set up a remote sync that will keep all files on the remote server and the local server sync'd up. Could change DNS upon internet outage and have it resolve to the local server?
This will depend on how your network is configured, there are two likely scenarios that I can think of:
Your web server is behind a router and port 80 is forwarded
Your web server has it's own IP address on the internet
In the first instance you shouldn't have to do anything unless you want to access the website using a URL (e.g. www.mywebserver.com) in which case you'll have to play some DNS tricks on the local network to get it to point to the local IP of the server instead of the actual internet IP. For example when accessed from the internet the dns record for www.mywebserver.com would point to 12.34.56.78 where as the dns record for any machine on the local network would be something like 192.168.0.10.
In the second case to my knowledge there is nothing you can do that will allow you to be able to access on the intranet (I could be wrong so if someone posts a solution in this case I'll update my answer).
So the answer to your question really depends on your network configuration, If you expand on that a little giving a more concrete answer will be a little easier.

Categories