Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ as the `app context <https://flask.palletsprojects.com/en/2.3.x/appcontext/>`_ i
from flask import current_app as app


@app.before_requestq
@app.before_request
def print_custom_message() -> None:
print("Executing before every request")
34 changes: 30 additions & 4 deletions providers/fab/docs/auth-manager/sso.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,33 @@ Configuration Steps

This replaces the default ``SimpleAuthManager``.

2. **Install Required Packages**
2. **Enable OAuth Authentication Type**

Set ``AUTH_TYPE`` to ``AUTH_OAUTH`` in your ``webserver_config.py`` file
(located at ``$AIRFLOW_HOME/webserver_config.py`` by default, configurable via
``[fab] config_file`` in ``airflow.cfg``):

.. code-block:: python

from flask_appbuilder.const import AUTH_OAUTH

AUTH_TYPE = AUTH_OAUTH

.. important::
This step is required. Without setting ``AUTH_TYPE = AUTH_OAUTH``,
the OAuth providers will not be activated even if ``OAUTH_PROVIDERS``
is configured. The default ``AUTH_TYPE = AUTH_DB`` uses database
authentication only.

.. note::
If the ``webserver_config.py`` file does not exist in your environment,
you need to create it manually. A template with default values and examples
can be found in the Airflow source at
``airflow-core/src/airflow/config_templates/default_webserver_config.py``.
You can copy this file to ``$AIRFLOW_HOME/webserver_config.py`` and modify
it for your needs.

3. **Install Required Packages**

If not already installed, ensure the FAB provider is available:

Expand All @@ -71,7 +97,7 @@ Configuration Steps
The FAB Auth Manager provider is not installed by default in Airflow 3.
You must install it explicitly to use OAuth2-based SSO.

3. **Configure OAuth2 Provider**
4. **Configure OAuth2 Provider**

FAB Auth Manager reads provider configuration from the ``[fab]`` section
of ``airflow.cfg`` or from environment variables.
Expand Down Expand Up @@ -119,13 +145,13 @@ Configuration Steps

Adjust these values according to your provider's documentation.

4. **Restart Airflow Webserver**
5. **Restart Airflow Webserver**

.. code-block:: bash

airflow webserver --reload

5. **Test SSO Login**
6. **Test SSO Login**

Open the Airflow UI. You should see a login option for your SSO provider.

Expand Down