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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:56:08+00:00 2026-06-10T21:56:08+00:00

The Remote API is not supported by Google App Engine when using federated login.

  • 0

The Remote API is not supported by Google App Engine when using federated login. However, apparently it is possible to use it in Python 2.5, as described here:

http://blog.notdot.net/2010/06/Using-remote-api-with-OpenID-authentication

Based on that solution and the comments below the article I have created the following Python 2.7 code:

app.yaml:

application: my_application
version: 1
runtime: python27
api_version: 1
threadsafe: true

builtins:
- appstats: on
#- remote_api: on

handlers:
- url: /remoteapi.*
  script: remote_api.app
- url: /.*
  script: main.app
  secure: never

remote_api.py:

from google.appengine.ext.remote_api import handler
from google.appengine.ext import webapp
import re

MY_SECRET_KEY = 'secret'
cookie_re = re.compile('^"?([^:]+):.*"?$')

class ApiCallHandler(handler.ApiCallHandler):
    def CheckIsAdmin(self):
        login_cookie = self.request.cookies.get('dev_appserver_login', '')
        match = cookie_re.search(login_cookie)
        if (match and match.group(1) == MY_SECRET_KEY
            and 'X-appcfg-api-version' in self.request.headers):
            return True
        else:
            self.redirect('/_ah/login')
            return False


app = webapp.WSGIApplication([('.*', ApiCallHandler)])

When I run the remote_api_shell command:

remote_api_shell.py -s my_application.appspot.com/remoteapi

This error is returned:

Traceback (most recent call last):
  File "remote_api_shell.py", line 133, in <module>
    run_file(__file__, globals())
  File "remote_api_shell.py", line 129, in run_file
    execfile(script_path, globals_)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\re
mote_api_shell.py", line 140, in <module>
    main(sys.argv)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\re
mote_api_shell.py", line 136, in main
    appengine_rpc.HttpRpcServer)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\re
mote_api_shell.py", line 76, in remote_api_shell
    rpc_server_factory=rpc_server_factory)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\remo
te_api\remote_api_stub.py", line 682, in ConfigureRemoteApi
    app_id = GetRemoteAppIdFromServer(server, path, rtok)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\remo
te_api\remote_api_stub.py", line 525, in GetRemoteAppIdFromServer
    response = server.Send(path, payload=None, **urlargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\ap
pengine_rpc.py", line 366, in Send
    f = self.opener.open(req)
  File "C:\Python27\lib\urllib2.py", line 400, in open
    response = meth(req, response)
  File "C:\Python27\lib\urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Python27\lib\urllib2.py", line 438, in error
    return self._call_chain(*args)
  File "C:\Python27\lib\urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 302: Found

What is wrong with my code? Is it possible to use the Remote API in Python 2.7 on Google App Engine using federated login?

  • 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-06-10T21:56:09+00:00Added an answer on June 10, 2026 at 9:56 pm

    There is nothing wrong with the code. Run the remote_api_shell command like so:

    remote_api_shell.py -s my_application.appspot.com -p /remoteapi
    

    When prompted for an email address, fill in the value of MY_SECRET_KEY. The password doesn’t matter.

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

Sidebar

Related Questions

I'm currently building a Python webapp on the Google App Engine and I want
I am building a app with many different parts which access remote api calls
I'm using boost::python to embed some python code into an app. I was able
I am trying to use Jenkins(Hudson) Remote API to consume XML response from a
I am building an application using WorldBank API, but WorldBank API does not support
I need only two app-engine related jars ( appengine-api-1.0-sdk-1.6.0.jar and appengine-api-labs-1.6.0.jar to be precise)
Here is a portion of my app.yaml file: handlers: - url: /remote_api script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
I have a problem to Store file (from a remote API) in MongoDB, i'm
I'm working on an API that accepts data from remote clients, some of which
I'm using the native drag and drop API in javascript. How can I remove

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.