2010-07-12 49 views
42

我以前问过question关于使用应用引擎的remote_api与openID,并且答案安全且不安全地运行良好。在某一点后不久,然而,有些东西在App Engine中改变了,该解决方案不再工作安全 - 即以下使用OpenID在应用引擎中保护remote_api

remote_api_stub.ConfigureRemoteDatastore(app_id=app_id, path='/remote_api', auth_func=auth_func, servername=host, secure=True) 

停止工作(总是返回302),我需要删除的安全参数来获得它工作。

release of the 1.3.5 SDK承诺'远程API命令可以通过HTTPS或HTTP发送',这让我感到困惑,因为我的印象是提供'secure = True'的论点已经给我这个了,基于this discussion

我怀疑是因为这个功能的释放导致'secure'参数停止工作。因此,我的问题的第一部分 - 是我在1.3.5发布之前通过使用'secure = True'参数来安全地运行remote_api命令?

一旦cookie hack停止安全工作,我试用了尼克约翰逊的解决方案列在同一个问题中,但是同样,我无法提供'secure = True',得到相同的302响应。

我需要做什么才能安全地使用openID运行remote_api? 1.3.5是否包含新的功能,以及如何使用它们?欢呼声中,

科林

+0

你用我的黑客还是尼克的黑客黑客? [http://blog.notdot.net/2010/06/Using-remote-api-with-OpenID-authentication] – 2010-07-12 14:16:37

+0

我试过两种 - 我得到同样的行为 - 设置'secure = True'总是会导致302 - 删除'安全=真'一切工作正常。我在remote_api入口点的app.yaml中有'secure:optional'。我原本是在secure = True的情况下成功使用你的黑客,然后有一天(大约在1.3.5发布前的公告)302开始返回。在这一点上,我尝试了尼克的黑客攻击手段,但它也只能在没有'secure = True'的情况下才能运行。我非常确定这不是cookie的问题,因为如果'secure = True'不存在,相同的cookie就可以正常工作。 – hawkett 2010-07-12 16:19:39

+0

安全的openid尚未在谷歌应用引擎上工作。 http://code.google.com/p/googleappengine/issues/detail?id=3586 – iamgopal 2010-08-21 07:37:39

回答

1

认为这

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

警告:在写这篇文章的时候,如果你的应用程序中使用HTTPS在安全模式下运行时,不支持OpenID的。

问候this去年修订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. 

那么,你有新的SDK试试吗?

+0

@eugene这是相同的信息,包含在@iamgopal在8月21日的评论中提供的链接。所以谷歌弃用1.3.5这个能力? – hawkett 2010-09-07 19:06:15

+0

我这么认为,也许我们应该等待1.3.6路线图来检查它。 – Eugene 2010-09-07 19:11:11

+0

@eugene 1.3.7不在。我不认为这个答案增加了问题/评论中尚未存在的任何内容。 – hawkett 2010-09-08 07:59:17

相关问题