Django 应用程序的 Google Apps OpenID 登录
我有一个为组织构建的 Django 应用程序。但是,所有用户都在组织的 Google 应用程序中拥有帐户。我们一直为他们保留两个独立的用户帐户(Google 应用程序和 django 应用程序),这不是很整洁。他们的 django 用户名与其 google apps 用户名相同(@domain.com
之前的部分)。
我想简单地更改 django 应用程序的登录页面,以便重定向到 google 应用程序进行身份验证(即 openid 类型登录)。此外,当他们登录时,我希望它返回具有相同用户名的用户,这样现有用户就可以登录到他们的原始帐户(因为他们在这些帐户下保存了内容)。新用户只会拥有一个使用该用户名创建的新 django 帐户。
不确定是否有人熟悉 googleappsauth。它是一个 Django 模块,允许 openid 登录 google apps 域。这对我来说似乎很完美。但是,它告诉我我需要定义一个 openid 端点。文档似乎没有表明这是必需的,但我对 OpenID 不太熟悉,所以我有点卡住了?
I have a django application built for an organization. But, all the users have accounts in the organization's google apps. We have been keeping two separate user accounts for them (google apps and the django app), which is not very neat. Their django username is the same as their google apps username (the part before @domain.com
).
I want to simply change the login page of my django app so that redirects to google apps for authentication (ie, openid type login). Additionally, when they are logged in I would like it to return the User with the same username, so that way existing users are logged into their original accounts (since they have stuff saved under those accounts). And new users will just have a new django account created with that username.
Not sure if anyone is familiar with googleappsauth. Its a django module to allow openid login to a google apps domain. This seems perfect for me. But, its telling me I need an openid endpoint defined. The documentation does not seem to indicate that that is required, but I'm not very familiar with OpenID so I'm kind of stuck??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
GOOGLE_OPENID_ENDPOINT = 'https://www.google.com/accounts/o8/ud'
GOOGLE_OPENID_ENDPOINT = 'https://www.google.com/accounts/o8/ud'
from: code.google.com
您还可以使用:
但是,请注意,如果您使用 python-openid,这会导致一些问题。补丁可用。
from: code.google.com
You can also use:
However, be aware that this causes some problems if you use python-openid. Patches are available.