Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API client configuration lack of support to pass verify_ssl for oauth based token authentication #106

Open
BalaMuralibi opened this issue Mar 22, 2024 · 0 comments

Comments

@BalaMuralibi
Copy link

Issue:
I am using airflow client with our own authentication based in azure AD , API is throwing forbidden error as stated below.

I think it is due to ssl cert verification is causing the issue, It would be great to have verify_ssl = true/false as parameter to configuration.

Github Code

https://github.com/apache/airflow-client-python/blob/8bf55dbc64d72ea318027c49ceda8d59490494c2/airflow_client/client/configuration.py#L118C3-L127C20

Suggestion for workaround

Can someone recommend any workaround to resolve my issue ?

Sample Code

import airflow_client.client
from pprint import pprint
from airflow_client.client.api import config_api


auth_backend = airflow.customauth

configuration = airflow_client.client.Configuration(
    host="http://localhost/api/v1",
    access_token='Bearer xxxxxxxxxxxx' 
)


# Enter a context with an instance of the API client
with airflow_client.client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = config_api.ConfigApi(api_client)

    try:
        # Get current configuration
        api_response = api_instance.get_config()
        pprint(api_response)
    except airflow_client.client.ApiException as e:
        print("Exception when calling ConfigApi->get_config: %s\n" % e)    

Error:

Exception when calling VariableApi->get_variables: (403)
Reason: Forbidden
HTTP response headers: HTTPHeaderDict({'Date': 'Fri, 22 Mar 2024 13:29:05 GMT', 'Content-Type': 'application/problem+json', 'Content-Length': '185', 'Connection': 'keep-alive', 'x-robots-tag':
'noindex, nofollow', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains'})
HTTP response body: {
"detail": null,
"status": 403,
"title": "Forbidden",
"type": "https://airflow.apache.org/docs/apache-airflow/2.8.1/stable-rest-api-ref.html#section/Errors/PermissionDenied"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant