WSGI中间件进行OAuth身份验证

WSGI中间件进行OAuth身份验证

本文介绍了WSGI中间件进行OAuth身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用构建了一个非常小的Web应用程序。现在我想添加非常基本的身份验证到网站(我不需要授权)。由于Flask不支持auth& auth开箱即用,所以我想插入一个WSGI中间件来完成这项工作。网络应用程序只有大约10人使用,他们都在Facebook上。所以我想使用Facebook的OAuth界面。



我很快浏览了,并注意到两件事情:可用中间件要么相当复杂,要么已经过时了。



我发现了以下软件包:


  • - 这是过时的。最后一次更新是2006年,我找不到任何在线文档

  • - 看起来很不错,但不支持OAuth

  • - - 似乎只支持 BASIC 和基于表单的认证。这也有点过时(最新版本是2008) ,这是身份验证框架带有插件的WSGI应用程序:


    • HTTP基本/摘要





    • 更多我不知道...


    I have build a very small web application using Flask. Now I would like to add very basic authentication to the site (I don't need authorization). As Flask does not support auth&auth out of the box, I'd like to plug in a WSGI middleware doing this job. The web-app is only used by roughly 10 people, all of them are on Facebook. So I'd like to use Facebook's OAuth interface.

    I've quickly looked through the wsgi.org list of WSGI Middleware and noticed two things: The available middleware is either quite complex to use, or it's already very dated.

    I have found the following packages:

    • wsgiauth -- It's dated. Last update is of 2006 and I cannot find any online docs
    • authkit -- Seems very nice, but does not support OAuth
    • barrel -- Seems to only support BASIC and Form based auth. It's also a bit dated (latest release is 2008)
    • webmodules -- Only supports BASIC auth

    Given this list, I'd say that AuthKit is the most interesting. Alas, it does not support OAuth. I will most likely go ahead and give it a shot. But, while I'm doodling around, I'm curious to see if there is anyone around who has a better solution lying around...

    解决方案

    You should take a look at repoze.who, which is authentication framework for WSGI application with plugins available for:

    • HTTP basic/digest
    • Auth via HTML forms with storing auth ticket in cookies.
    • OpenID
    • OAuth
    • LDAP
    • Many more I don't know...

    这篇关于WSGI中间件进行OAuth身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 08:18