facebookLogin

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2017 License: Apache-2.0 Imports: 1 Imported by: 0

README

facebookLogin

The simple server-side facebook login flow.

How to install

Grab the latest version:

go get -u github.com/Tri125/facebookLogin

facebookLogin uses dep to manage its dependencies.

Install dep:

go get -u github.com/golang/dep/cmd/dep

Install the dependencies:

dep ensure

Install facebookLogin:

go build

Run the proxy

Preparation

Follow the instruction from facebook to create your facebook application.

You will want to Require App Secret and create a Facebook Login product.

Under the Settings > Basic tab at the top left, take note of your appID and appSecret.

Your appID can be public but you have to secure the appSecret at all cost.

Under the settings tab of the Facebook Login product, write all of your Valid OAuth redirect URI.

This is the URI(s) where your login button is present.

You can write http://localhost:8080 if you are going to run locally on the default port.

Usage

Just execute the program while supplying the appID and appSecret flags, you can also set them through environment variables:

./facebookLogin --appID <appID> --appSecret <secret>

You can now make call to the proxy in the following format:

curl -X POST -d '{"token": "<fbToken>"}' localhost:8080?field="first_name,last_name,email,locale"

If you would like a full demo environment, run the local command:

./facebookLogin local --appID <appID> --appSecret <secret>

This will generate a website where you will be able to test how everything works.

Just open a website at http://localhost:8080/dev and look at the javascript console.

For more information on the available commands:

./facebookLogin --help

How to modify the template

Modify templates/index.html

Install go-bindata:

go get -u github.com/jteeuwen/go-bindata/...

Convert the file into Go source file and overwrite bindata.go:

go-bindata -o data/bindata.go templates/

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL