google / google/googleapis.dart
Call an authenticated service using service account
- 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
Assessment
This issue has not been assessed yet.