0

We've set up Airflow 2.3.3 to authenticate users against Azure AD by means of OAuth-2. So our webserver_config.py holds AUTH_TYPE = AUTH_OAUTH and an OAuth provider. Authenticating users in Airflow's web GUI works perfectly fine.

Now we'd like to use Airflow's Rest-API (e.g. in order to schedule runs).

The official documentation is a bit unclear to me, though. It says:

Authentication for the API is handled separately to the Web Authentication. The default is to check the user session

I'd like to avoid using Basic Auth only for our API calls, but instead also use authentication via OAUTH for our API calls. So it's fine to have the API backend check the current user session.

But - how do we create this user session prior to our API calls?

Any examples for bash / cURL / python are appreciated.

dovregubben
  • 364
  • 2
  • 16
  • Hi dovregubben, any tip for a person who does not know a lot for azure graph, azure ad while trying to setup airflow with azure ad for authentication? currently i have "Invalid login. Please try again." error when click the button/icon of the azure sign in. I referred to this article: https://objectpartners.com/2021/12/24/enterprise-auth-for-airflow-azure-ad/ – soMuchToLearnAndShare Jan 09 '23 at 13:46
  • 1
    Hey, it's a bit difficult to say since you haven't provided any configuration details. I quickly went over the article, and I believe it misses some hint as to also add users to your app role. Have you assigned your user(s) to your app role? Just a quick guess... Otherwise you might want to post a separate question and provide further information? – dovregubben Jan 11 '23 at 08:54
  • Problem solved. Missed mapping user to app roles , did not know it is hidden under enterprise application tab. – soMuchToLearnAndShare Jan 12 '23 at 19:47

0 Answers0