simdb.remote.core.auth.active_directory module

class simdb.remote.core.auth.active_directory.ActiveDirectoryAuthenticator[source]

Bases: Authenticator

Authenticator for authenticating using an LDAP server.

This requires the following extra parameters in the server configuration: ad_server - the server URI ad_domain - the AD domain ad_cert - path to the root ca certificate

Name : str = 'ActiveDirectory'
authenticate(config: Config, request: Request) User | None[source]

Authenticate the user using parameters passed in the current request - i.e. username/password passed as part of SimpleAuth or a token in the request header.

Additional authentication options can be defined in the configuration specific to the type of authentication being performed - i.e. connection URI for LDAP server.

Parameters:
config: Config

The SimDB configuration object.

request: Request

The Flask request object.

Returns:

A User object if the user successfully authenticates, otherwise None.