Welcome | Get started | Dive into Lino | Contribute | Topics | Reference | More

lino.core.auth.middleware

Functions

get_user(request)

request2data(request[, user_language])

Classes

AuthenticationMiddleware(get_response)

NoUserMiddleware(get_response)

RemoteUserMiddleware(get_response)

Middleware for utilizing Web-server-provided authentication.

WithUserMiddleware(get_response)

class lino.core.auth.middleware.RemoteUserMiddleware(get_response)

Bases: MiddlewareMixin

Middleware for utilizing Web-server-provided authentication.

If request.user is not authenticated, then this middleware attempts to authenticate the username passed in the REMOTE_USER request header. If authentication is successful, the user is automatically logged in to persist the user in the session.

The header used is configurable and defaults to REMOTE_USER. Subclass this class and change the header attribute if you need to use a different header.

clean_username(username, request)

Allows the backend to clean the username, if the backend defines a clean_username method.