AuthenticationMiddleware class¶
Warning
The current page still doesn't have a translation for this language.
But you can help translating it: Contributing.
This is the reference for the main object AuthenticationMiddleware that contains all the parameters,
attributes and functions.
Use this class for authentication middleware in Ravyn.
ravyn.middleware.authentication.AuthenticationMiddleware
¶
AuthenticationMiddleware(app, backend=None, on_error=None)
Bases: AuthenticationMiddleware
| PARAMETER | DESCRIPTION |
|---|---|
app
|
The ASGI application callable wrapped by this middleware.
TYPE:
|
backend
|
One or more authentication backends used to authenticate the connection. If multiple backends are provided, they are tried in order.
TYPE:
|
on_error
|
An optional error handler function called when authentication fails. It receives the Connection and AuthenticationError and must return an ASGI-compatible Response object.
TYPE:
|
Source code in ravyn/middleware/authentication.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
authenticate
async
¶
authenticate(conn, **kwargs)
Authorize users here.
Source code in lilya/middleware/authentication.py
124 125 126 127 128 129 130 131 132 | |
default_on_error
staticmethod
¶
default_on_error(connection, exc)
Source code in lilya/middleware/authentication.py
99 100 101 | |
ravyn.middleware.authentication.AuthResult
¶
- "!^model_config"