diff --git a/docs/apache-airflow/security/webserver.rst b/docs/apache-airflow/security/webserver.rst index 9e4c947ee7a8..d990afa4d453 100644 --- a/docs/apache-airflow/security/webserver.rst +++ b/docs/apache-airflow/security/webserver.rst @@ -169,14 +169,14 @@ Here is an example of what you might have in your webserver_config.py: .. code-block:: python + from airflow.www.security import AirflowSecurityManager from flask_appbuilder.security.manager import AUTH_OAUTH import os AUTH_TYPE = AUTH_OAUTH AUTH_ROLES_SYNC_AT_LOGIN = True # Checks roles on every login AUTH_USER_REGISTRATION = True # allow users who are not already in the FAB DB to register - # Make sure to replace this with the path to your security manager class - SECURITY_MANAGER_CLASS = "your_module.your_security_manager_class" + AUTH_ROLES_MAPPING = { "Viewer": ["Viewer"], "Admin": ["Admin"], @@ -199,6 +199,14 @@ Here is an example of what you might have in your webserver_config.py: }, ] + + class CustomSecurityManager(AirflowSecurityManager): + pass + + + # Make sure to replace this with your own implementation of AirflowSecurityManager class + SECURITY_MANAGER_CLASS = CustomSecurityManager + Here is an example of defining a custom security manager. This class must be available in Python's path, and could be defined in webserver_config.py itself if you wish.