在Google App Engine中自定义登录 [英] Customize login in Google App Engine
问题描述
我需要为登录添加更多选项,因此需要使用一些HTML代码自定义create_login_url。
有没有在Google的默认登录屏幕上添加代码的方法?
环境:Python Google App Engine)
我想继续使用默认的Google ext class Users行为。
Nick Johnson最近发布了一个alpha版本的您可以使用的WSGI中间件。该API与应用程序引擎中的标准用户API非常相似。这是一种通过OpenID支持身份验证的方式(Alex Martelli在他的回答)。因此,您可以支持Google作为身份提供者以及其他人。如果你只是想为某些原因支持谷歌账户,你当然只能将它们列入白名单。
- 用户由其OpenID端点唯一标识。
- 您无法构建用户对象,而不指定OpenID URL。
- 昵称和电子邮件地址是用户提供的,因此不保证它们是唯一的或经过验证的。 is_current_user_admin )尚未实现。
- 登录:app.yaml中的子句不受AEoid影响 - 它们仍使用常规用户API进行身份验证。
I need to add few more options for login and therefore need to customize create_login_url with some HTML code.
Is there a way to add on your code in default login screen of Google?
Environment: Python (Google App Engine)
I want to continue having the default Google ext class Users behavior in place.
Nick Johnson recently released an alpha version of a WSGI middleware that you could use. The API is very similar to the standard Users API in app engine. It is a way to support auth via OpenID (something Alex Martelli suggested in his answer). Therefore you are able to support Google as Identity Provider as well as others. If you only want to support Google accounts for some reason, you could certainly only whitelist them though.
Nick's blog announcement also lists some things to consider (these might be deal-breakers for you):
- Users are identified uniquely by their OpenID endpoint.
- You can't construct a User object without specifying an OpenID URL.
- Nicknames and email addresses are user-supplied, so they're not guaranteed unique or validated.
- is_current_user_admin() is not yet implemented.
- login: clauses in app.yaml are not affected by AEoid - they still authenticate using the regular Users API.
这篇关于在Google App Engine中自定义登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!