使用oauth2保护静态网站的最简单方法

时间:2015-01-20 22:18:47

标签: python node.js oauth-2.0 python-sphinx

我想通过google oauth2保护我的公司文档(使用Sphinx创建的静态网站)。

实现这一目标的最简单方法是什么?我确切地说,我更像是一个python和javascript的家伙。欢迎创意或图书馆名称!

谢谢!

1 个答案:

答案 0 :(得分:0)

如果您使用Apache网络服务器为该网站提供服务(或在该内容之前使用Apache作为反向代理),您可以使用mod_auth_openidc版本1.7.2,并支持验证Google的访问令牌。 configuration看起来像是:

OIDCOAuthIntrospectionEndpoint https://www.googleapis.com/oauth2/v1/tokeninfo
OIDCOAuthIntrospectionTokenParamName access_token
OIDCOAuthRemoteUserClaim user_id

<Location /static/>
    Authtype oauth20
    # require specific claims to be present in the JSON
    # response returned from the token info endpoint
    Require claim issued_to:<client_id>
</Location>
相关问题