Airflow webserver authentication with Google SSO and Helm

May 3, 2024

I've been grappling around to get the Google SSO working on Airflow. There is limited documentation online or a successful case. This post shares how this can be achieved. And this post assumes that you've already setup airflow in a chosen environment using official helm chart from Airflow documentation.

Airflow PiPy with google_auth extra

Whichever way you are using to build the airflow custom image, make sure to include below package.

pip3 install apache-airflow[google_auth]

Create OAuth 2.0 credentials on Google cloud console

Head over to your Google cloud console and create OAuth 2.0 credentials by providing the required details. Most notable of them being redirect_uri.

Download the credentials json file that includes information like client_id, client_secret etc.

Changes to your values.yaml

        authenticate: True
        auth_backend: airflow.contrib.auth.backends.google_auth
        client_id: ''
        client_secret: ''
        oauth_callback_route: '' #where to redirect after a successful login
        prompt: <One of : consent, select_account, none or ''>
    webserverConfig: |-
        from import AUTH_OAUTH
        AUTH_USER_REGISTRATION_ROLE = 'Viewer' # first user may be Admin
        OAUTH_PROVIDERS = [{
            'remote_app': {
                 'scope': 'email profile'
               'request_token_url': None,
               'client_id': <replace with google client id>,
               'client_secret': <replace with google secret>,

Helm upgrade or install

Apply the changes and do a logout if required and try to test the login flow with google!