wsgi_tools.basic_auth module

Basic Auth implementation in WSGI.

class wsgi_tools.basic_auth.BasicAuth(app, is_correct, realm='Access to content')

Bases: object

A WSGI-app which asks you to authenticate if you are not and forwards the request otherwise.

Parameters
  • app – The WSGI-app with authenticated access only

  • is_correct – a function which processes username and the passwd, whether it is correct or wrong.

  • realm (str, optional) – String describing, what is forbidden without authentication.

property user

The user which is logged in in this request.

Type

str