Alexandre Schaffner
Alexandre Schaffner

Reputation: 29

How to authenticate to Cloud Composer Airflow REST API

I try to authenticate an HTTP call to the Cloud Composer Airflow REST API from a Cloud Run service in a different project. I want to programmatically trigger a DAG run. I don't understand how to do it. The documentation is not clear about how to forge the request.

I tried to use the Swagger provided by my Cloud Composer environment to inspect the request made to trigger a DAG, but the authentication / authorization process seems to be handled by a session cookie.

What I understood from the documentation is that there are other ways to authenticate HTTP calls like OAuth2, but it's not clear how to do it without a Python script (I'm open to use a node library though).

I want to know how I can craft an authenticated HTTP call without using any libraries. It should be straightforward but I can't find the documentation for that. Should I use specific headers ? How can I get the credentials of my service account ? etc.

Upvotes: 0

Views: 30

Answers (1)

Alexandre Schaffner
Alexandre Schaffner

Reputation: 29

GCP automatically authentify calls made by service accounts when using client libraries like gaxios.

Upvotes: 0

Related Questions