Permalink
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (20 sloc) 1.09 KB

Signed requests

You may parse signed requests using the SignedRequest class:

from facepy import SignedRequest

# Parse a signed request into a Python dict
signed_request_data = SignedRequest.parse(signed_request, facebook_application_secret_key)

# Get a SignedRequest object
signed_request = SignedRequest(signed_request, facebook_application_secret_key)

# Print the Facebook ID of the user that generated the signed request
print signed_request.user.id

# Print the OAuth access token for the user that generated the signed request
print signed_request.oauth_token.token

# Reverse-engineer the signed request
signed_request.generate(facebook_application_secret_key)
.. autoclass:: facepy.SignedRequest
    :members: parse, user, data, page, oauth_token, generate, User, Page, OAuthToken