Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WSGI Middleware for OAuth authentication

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...

like image 466
exhuma Avatar asked Jan 10 '11 16:01

exhuma


People also ask

What is WSGI middleware?

A WSGI middleware is a WSGI application that wraps another application in order to observe or change its behavior. Werkzeug provides some middleware for common use cases. X-Forwarded-For Proxy Fix. Serve Shared Static Files. Application Dispatcher.

What is OAuth in flask?

Flask-OAuth is an extension to Flask that allows you to interact with remote OAuth enabled applications. Currently it only implements the consumer interface so you cannot expose your own API with OAuth. Flak-OAuth depends on the python-oauth2 module.


1 Answers

Flask has an OpenAuth extension that's written by the Armin Ronacher (Flask's author). It provides Flask with support for Open Auth 1.0.

like image 56
Sean Vieira Avatar answered Sep 23 '22 02:09

Sean Vieira