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 3999460
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:39:36+00:00 2026-05-20T07:39:36+00:00

I am using the Server Side flow to get a user’s permissions to access

  • 0

I am using the “Server Side” flow to get a user’s permissions to access some information using Python on Google Appengine.

I am able to get the server generated code from Facebook after the user clicks on the “Allow” button.

However when I get the access token, I run into the following error:

Traceback (most recent call last):
File
“/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/init.py”,
line 515, in call
handler.get(*groups) File “/base/data/home/apps/finisherph/1.348502373491720746/controllers.py”,
line 21, in get
data = urllib2.urlopen(access_token_url)
File
“/base/python_runtime/python_dist/lib/python2.5/urllib2.py”,
line 124, in urlopen
return _opener.open(url, data) File
“/base/python_runtime/python_dist/lib/python2.5/urllib2.py”,
line 387, in open
response = meth(req, response) File
“/base/python_runtime/python_dist/lib/python2.5/urllib2.py”,
line 498, in http_response
‘http’, request, response, code, msg, hdrs) File
“/base/python_runtime/python_dist/lib/python2.5/urllib2.py”,
line 425, in error
return self._call_chain(*args) File
“/base/python_runtime/python_dist/lib/python2.5/urllib2.py”,
line 360, in _call_chain
result = func(*args) File “/base/python_runtime/python_dist/lib/python2.5/urllib2.py”,
line 506, in http_error_default
raise HTTPError(req.get_full_url(), code,
msg, hdrs, fp) HTTPError: HTTP Error
400: Bad Request

Here’s the code in my controller where the response from facebook goes after user clicks on the “Allow” button. It’s still a hack so the code is a little bit dirty. Still trying to make it work.

class Register(webapp.RequestHandler):
            def get(self):
                code=self.request.get('code')
                logging.debug("code: "+code)
                accesst_url=["https://graph.facebook.com/oauth/access_token?"]
                accesst_url.append("client_id=CLIENT_ID&")
                import urllib         
                accesst_url.append(urllib.urlencode
                    ({'redirect_uri':'http://my.website.com/register/facebook/'}))
                accesst_url.append('&')
                accesst_url.append("client_secret=CLIENT_SECRET&")
                accesst_url.append("".join(["code=",str(code)]))
                logging.debug(accesst_url)
                access_token_url="".join(accesst_url)
                logging.debug(access_token_url)
                import urllib2
                data = urllib2.urlopen(access_token_url)
                    ...
                    ...

The error occurs here:

data = urllib2.urlopen(access_token_url)

when I copy and paste the access_token_url from my logs, I get the following error:

{ “error”: {
“type”: “OAuthException”,
“message”: “Error validating verification code.” } }

What am I missing here?

  • 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-20T07:39:37+00:00Added an answer on May 20, 2026 at 7:39 am

    It looks like you are trying to access the access_token as url, which is not quite right.

    Here is an example which illustrates how OAuth authentication via FB is done over GAE.

    • You go to the https://graph.facebook.com/oauth/authorize? with your client_id and redirect_uri
    • Upon authorization, it gives a code and you use code and client_secret to get an access_token from https://graph.facebook.com/oauth/access_token
    • And then you use that access_token to operate as the Facebook user.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Google Maps v3 and I build in the server side a json
I'm trying to access user's language preference w/o using server code. I'm looking for
I am handling the authentication using the server side oauth flow. All that is
How to construct a GQL query using server side admin datastore viewer, a one
I am just getting started creating an AJAX application using server side push. I
I would like to know how threads are handled on the server side using
I am using GDI+ on the server-side to create an image which is streamed
I am using a regular expression in javascript and want to do server side
I am validating a zip code using Javascript that is generated server-side, and injected
For example, writting server-side things using javascript, instend of php.

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.