Skip to content

Authentication

sqladmin.authentication.AuthenticationBackend

Base class for implementing the Authentication into SQLAdmin. You need to inherit this class and override the methods: login, logout and authenticate.

__init__(secret_key)

authenticate(request) async

Implement authenticate logic here. This method will be called for each incoming request to validate the authentication.

If a 'Response' or RedirectResponse is returned, that response is returned to the user, otherwise a True/False is expected.

login(request) async

Implement login logic here. You can access the login form data await request.form() andvalidate the credentials.

logout(request) async

Implement logout logic here. This will usually clear the session with request.session.clear().