Rack middleware for verifying and parsing Facebook signed_request param on canvas applications
Ruby
Pull request Compare This branch is 12 commits ahead of gamesthatgive:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
Gemfile
Gemfile.lock
LICENSE.txt
README.md
Rakefile
VERSION
rack-facebook-signed-request.gemspec

README.md

rack-facebook-signed-request

Rack middleware which parses and verifies the signed_request canvas parameter and FB JS cookie.

See Facebook's Canvas Documentation for more details.

Required Options

You must specify the following options to enable the middleware:

  • app_id
  • secret

Additional Custom Options

You can also activate the following options:

  • inject_facebook (default: false): This will automatically inject the asynchronous FB JS SDK include into the response body.

Assuming you've enabled the Facebook script injection, you can customize these options:

  • cookie (default: true): Configure the FB JS SDK with cookie support
  • status (default: true)
  • lang (default: 'en_US')
  • xfbml (default: true)

Note that this will also add the FB XML namespace attribute into the root html element of the response.

RESTful behavior

The Rack middleware will also convert any POST requests containing the signed_request parameter to GET.