google / google/googleapis.dart

Call an authenticated service using service account

Open
#527 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
419
Forks
136
Avg merge
1h 21m
Merged PRs (30d)
5

Description

I have my flutter app running under a service account and my API running under another service account. My API only accepts authenticated access. I am using the architecture described [here](https://cloud.google.com/run/docs/tutorials/secure-services).

I tested access to it using CURL and using "gcloud auth print-identity-token flutter-identity-sa" command to generate the identity token and it works fine.

Then I tried to implement the code on Flutter using the clientViaServiceAccount method and passing ServiceAccountCredentials but I got a 403 error. I checked the call in the browser and the request is being made using the access token instead of the identity token in the authorization header. Is there a way AuthClient uses the identity token in the authorization header?

Thank you!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.