Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4027286
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:04:41+00:00 2026-05-20T11:04:41+00:00

Facebook released released a registration plugin here http://developers.facebook.com/docs/user_registration few weeks ago. I was wondering

  • 0

Facebook released released a registration plugin here
http://developers.facebook.com/docs/user_registration few weeks ago.

I was wondering how can we implement this with Tornado?

I kept receiving an error: 403 POST /auth/fbform (127.0.0.1): ‘_xsrf’ argument missing from POST

The redirect_url is http://localhost:8888/auth/fbform
And the code is as follows:

class FBFormLoginHandler(BaseHandler, tornado.web.RequestHandler):
    def get(self):
        print "i'm in GET"
        print self.request
        # parse and check data
        data = _parse_signed_request(self.request['_xsrf'], "XXXXX")
        return
    def post(self):
        print "i'm in POST"
        print self.request
        # parse and check data
        data = _parse_signed_request(self.request['_xsrf'], "XXXXX")
        return

    def _parse_signed_request(signed_request, app_secret):
        print "hello in parse_signed_request"
        try:
          l = signed_request.split('.', 2)
          encoded_sig = str(l[0])
          payload = str(l[1])
        except IndexError:
          raise ValueError("'signed_request' malformed")

        sig = base64.urlsafe_b64decode(encoded_sig + "=" * ((4 - len(encoded_sig) % 4) % 4))
        data = base64.urlsafe_b64decode(payload + "=" * ((4 - len(payload) % 4) % 4))

        data = json.loads(data)

        if data.get('algorithm').upper() != 'HMAC-SHA256':
          raise ValueError("'signed_request' is using an unknown algorithm")
        else:
          expected_sig = hmac.new(app_secret, msg=payload, digestmod=hashlib.sha256).digest()

        if sig != expected_sig:
          raise ValueError("'signed_request' signature mismatch")
        else:
          return data

I do not understand which POST the error message is talking about, so
I tried to use the _parse_signed_request from the get and post function.

Please enlighten me.
I’m currently working from my local computer by the way.

Best Regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:04:41+00:00Added an answer on May 20, 2026 at 11:04 am

    You have to disabled CSRF checking on that endpoint since the request is coming from Facebook and not your own site

    http://www.tornadoweb.org/documentation#cross-site-request-forgery-protection

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a facebook game application that is released at facebook platform at the
I have a game application released at the Facebook platform. I need to set
Facebook now offer subscriptions to users so you can get realtime updates on changes.
Facebook apps are allowed to have a tab that a user can add to
Facebook released new API that works perfectly on iOS4. The API's that are in
Facebook Connect seems like the cool new way to leverage a user's Facebook account
In Facebook's Compose Message, each name that appears in the TO field uses a
My Facebook application contains Javascript that works in Firefox and IE, but aborts in
I am building a Facebook App which is heavy on Javascript. For this I
Using the Facebook API, is there a way of getting a friend's phone/cell number?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.