Tornado Documentation
http://www.v2ex.com/tornado/
Tornado on GitHub
https://github.com/facebook/tornado/
Tornado Gists
http://tornadogists.org/
Livid
291.9D
556.91D
V2EX  ›  Tornado

貌似 Tornado 里的 GoogleOAuth2Mixin 其实没有完整实现

  •  
  •   Livid ·
    PRO
    · Jun 8, 2014 · 5185 views
    This topic created in 4397 days ago, the information mentioned may be changed or developed.
    因为 Google 在 5.19 的时候已经关闭了新域名的 OpenID 验证,所以今天试验了一下 OAuth 2 验证,发现有坑啊……

    https://github.com/tornadoweb/tornado/blob/master/tornado/auth.py

    http://www.mastortosa.com/entries/googleapi-oauth-tornado
    2 replies    2014-11-19 10:02:22 +08:00
    misaka
        1
    misaka  
       Jun 8, 2014
    对,之前我发现 GoogleOAuth2Mixin 用不起来,临时急用就换了 OpenID,现在正准备改用
    http://google-api-python-client.googlecode.com/hg/docs/epy/oauth2client-module.html
    Livid
        2
    Livid  
    MOD
    OP
    PRO
       Nov 19, 2014
    get_authenticated_user 返回的 dict 里包含的信息是:

    access_token
    token_type
    expires_in
    id_token

    然后 FacebookGraphMixin 是带 get_user_info 的,但是 GoogleOAuth2Mixin 里就没有这个 get_user_info,还需要自己去 https://www.googleapis.com/oauth2/v2/userinfo 拿。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3165 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 12:42 · PVG 20:42 · LAX 05:42 · JFK 08:42
    ♥ Do have faith in what you're doing.