使用OpenID在app引擎中保护remote_api

haw*_*ett 42 openid google-app-engine

我以前问一个问题关于使用App Engine的remote_api的使用OpenID,答案运作良好,既安全,不安全.然而,在不久之后的某个时刻,应用程序引擎中的某些内容发生了变化,解决方案不再安全地运行 - 即以下内容

remote_api_stub.ConfigureRemoteDatastore(app_id=app_id, path='/remote_api', auth_func=auth_func, servername=host, secure=True)
Run Code Online (Sandbox Code Playgroud)

停止工作(总是返回302),我需要删除安全参数才能使其工作.

1.3.5 SDK发布承诺"远程API命令可以通过HTTPS或HTTP发送",这让我很困惑,因为我认为提供'secure = True'论证已经给了我这个,基于这个讨论.

我怀疑是这个功能的发布导致"安全"论点停止工作.所以我的问题的第一部分 - 我是否在1.3.5发布之前使用'secure = True'参数安全地运行remote_api命令?

一旦cookie hack安全地停止工作,我尝试了在同一个问题中列出的Nick Johnson的解决方案,但同样,我也无法提供'secure = True',获得相同的302响应.

使用openID安全地运行remote_api需要做什么?1.3.5是否包含围绕此功能的新功能,以及如何使用它们?干杯,

科林

Eug*_*ene 1

问候这个

http://code.google.com/intl/en-US/appengine/articles/openid.html

警告:在撰写本文时,如果您的应用程序使用 HTTPS 在安全模式下运行,则不支持 OpenID。

在 1.3.7 版本的最新版本中对此表示欢迎

def ConfigureRemoteDatastore(app_id,
                             path,
                             auth_func,
                             servername=None,
                             rpc_server_factory=appengine_rpc.HttpRpcServer,
                             rtok=None,
                             secure=False):
  """Does necessary setup to allow easy remote access to an AppEngine datastore.

  Either servername must be provided or app_id must not be None.  If app_id
  is None and a servername is provided, this function will send a request
  to the server to retrieve the app_id.

  Args:
    app_id: The app_id of your app, as declared in app.yaml.
    path: The path to the remote_api handler for your app
      (for example, '/remote_api').
    auth_func: A function that takes no arguments and returns a
      (username, password) tuple. This will be called if your application
      requires authentication to access the remote_api handler (it should!)
      and you do not already have a valid auth cookie.
    servername: The hostname your app is deployed on. Defaults to
      <app_id>.appspot.com.
    rpc_server_factory: A factory to construct the rpc server for the datastore.
    rtok: The validation token to sent with app_id lookups. If None, a random
      token is used.
    secure: Use SSL when communicating with the server.
Run Code Online (Sandbox Code Playgroud)

那么,你用新的sdk尝试过吗?