我一直在努力工作一段时间,试图在Google App Engine上安装SimpleAuth,并且遇到麻烦。首先在示例代码的底部,他们有这个:安装SimpleAuth for GAE时遇到问题
def _get_consumer_info_for(self, provider):
"""Should return a tuple (key, secret) for auth init requests.
For OAuth 2.0 you should also return a scope, e.g.
('my app id', 'my app secret', 'email,user_about_me')
The scope depends solely on the provider.
See example/secrets.py.template
"""
return secrets.AUTH_CONFIG[provider]
我没有看到秘密文件,也没有看到它应该做什么。
然后除了这个小问题,我很好奇我应该如何呈现供应商和他们的登录URL给用户。本页面:https://github.com/crhym3/simpleauth/blob/master/example/handlers.py对常规设置有很好的描述,但它没有任何描述,我们实际需要传递给用户以让他们登录。
谢谢!
感谢您的有益的职位。这清除了我的一个重要问题,但是我已经阅读了自述文件,而且我没有看到任何名为secrets.py的文件,这导致了一些混淆。这是我们应该自己创建的文件吗? – clifgray
是的。有一个模板,你可以从什么开始,完全相同的secretts.py。这是example/secrets.py.template:https://github.com/crhym3/simpleauth/blob/master/example/secrets.py.template只需将其复制到secrets.py(没有“.template”结尾)并修改它,即设置真正的客户/秘密。 – alex