2

I tried login in via Azure AD in airflow container. I setting de webserver_config.py

OAUTH_PROVIDERS = [
    { 
        'name':'azure', 'token_key':'access_token', 'icon':'fa-windows',
        'remote_app': {
            "api_base_url": "https://login.microsoftonline.com/$TENANT_ID",
            "request_token_url": None,
            'request_token_params': {
                'scope': 'openid email profile'
            },
            "access_token_url": "https://login.microsoftonline.com/$TENANT_ID/oauth2/v2.0/token",
            "access_token_params": {
                'scope': 'openid email profile'
            },
            "authorize_url": "https://login.microsoftonline.com/$TENANT_ID/oauth2/v2.0/authorize",
            "authorize_params": {
                'scope': 'openid email profile'
            },
            'client_id':'CLIENTE_ID',
            'client_secret':'CLIENTE_SECRET'
        }
    }

]

Log Webserver UI

See logging

Error authorizing OAuth access token: Missing "jwks_uri" in metadata
alexis.araya
  • 95
  • 1
  • 10

1 Answers1

3

I found solution, adding authlib 1.0.1 and add

OAUTH_PROVIDERS = [
{ 
    'name':'azure', 'token_key':'access_token', 'icon':'fa-windows',
    'remote_app': {
        "api_base_url": "https://login.microsoftonline.com/$TENANT_ID",
        "request_token_url": None,
        'request_token_params': {
            'scope': 'openid email profile'
        },
        "access_token_url": "https://login.microsoftonline.com/$TENANT_ID/oauth2/v2.0/token",
        "access_token_params": {
            'scope': 'openid email profile'
        },
        "authorize_url": "https://login.microsoftonline.com/$TENANT_ID/oauth2/v2.0/authorize",
        "authorize_params": {
            'scope': 'openid email profile'
        },
        'client_id':'CLIENTE_ID',
        'client_secret':'CLIENTE_SECRET',
        'jwks_uri': 'https://login.microsoftonline.com/common/discovery/v2.0/keys
    }
}
alexis.araya
  • 95
  • 1
  • 10
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 29 '22 at 03:50
  • my case i did not need to install `authlib` because: my one shows ```airflow@airflow-webserver-7cd49659dd-cd9x5:/opt/airflow$ pip freeze |grep auth gcloud-aio-auth==4.0.1 google-auth==2.14.1 google-auth-httplib2==0.1.0 google-auth-oauthlib==0.7.1 oauthlib==3.2.2 pydata-google-auth==1.4.0 requests-oauthlib==1.3.1 ``` – soMuchToLearnAndShare Jan 10 '23 at 15:01