As google documented, developers can use gcloud auth print-identity-token
to generate a development-only id_token to authenticate to Cloud Run. If I base64 decode the resulting id_token, I can see the aud
claim is set to 32555940559.apps.googleusercontent.com, which is the client_id of the google cloud sdk:
Is this an exception to the rule outlined in service-to-service authentication, which says target_audience
needs to be set to the url of the receiving service (e.g., https://xxxxx.run.app).Is aud
and target_audience
the same thing?
Lastly, is there an alternative way to authenticated with user account instead of service account, other than using googlecloudsdk (i.e. imaging gcloud auth print-identity-token
doesn't exist)?