在Google App Engine中自定义登录 [英] Customize login in Google App Engine

查看:128
本文介绍了在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作为身份提供者以及其他人。如果你只是想为某些原因支持谷歌账户,你当然只能将它们列入白名单。



Nick的博客

>

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆