使用Python openid库将openid\u shutdown\u ack参数传递给我的applicion

2024-04-26 08:14:12 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个使用Python OpenID库的应用程序。我用它来验证我的应用程序对谷歌帐户。你知道吗

Google不赞成openid2.0身份验证。为了购买一些外部迁移时间,允许使用一个额外的参数(google docs openID)。你知道吗

如何使用Python openid库将传递的openid\u shutdown\u ack参数添加到applicion中?你知道吗


Tags: 身份验证应用程序docs参数google时间帐户openid
1条回答
网友
1楼 · 发布于 2024-04-26 08:14:12

我发现以下解决方案扩展了AuthRequest的getMessage方法

def extend_with_openid_shutdown_ack(self, realm, return_to=None, immediate=False):
    message = consumer.AuthRequest.getMessage(self, realm, return_to, immediate)
    message.setArg(consumer.BARE_NS, 'openid_shutdown_ack','2015-04-20')
    return message

然后在从consumer begin()方法获取请求实例时替换实例的函数

request.getMessage = extend_with_openid_shutdown_ack.__get__(request, type(request))

相关问题 更多 >