Skip to content

Using Facebook authentication from a local machine

ygaras edited this page Oct 9, 2012 · 1 revision

Simply put, the last step of facebook authentication works by redirecting the client browser to the url of the application with certain secrets to identify the user.

We can redirect all traffic going to a certain remote site to go to our own machine by editing hosts file. Assuming a facebook application is set to use the url hawks.hub43.com, add the following line to your hosts file:

127.0.0.1 hawks.hub43.com

The hosts file is at :

C:\WINDOWS\system32\drivers\etc\hosts

You can edit the file using any text editor. To make sure your updates are working fine, issue a ping command and make sure the results are as below:

E:\www\dev\basbosa>ping hawks.hub43.com

Pinging hawks.hub43.com [127.0.0.1] with 32 bytes of data:

Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
	Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
	Minimum = 0ms, Maximum = 0ms, Average = 0ms

Now you need to make sure you are running basbosoa on port 80, something like:

node --debug app.js -p 80

Make sure no other programs are using port 80, skype uses port 80 you better disable that.

http://www.mydigitallife.info/disable-skype-from-using-opening-and-listening-on-port-80-and-443-on-local-computer/

Clone this wiki locally