If by the C# SDK you mean Google.Cloud.Storage.V1 + Google.Apis.Auth then as of 2023-05-16, external account credentials (Workload ID) are not supported as URL signers and you need to use the IAM service to sign the blob yourself. You can find this information in the Google.Cloud.Storage.V1 library documentation:
Google.Apis.Auth.OAuth2.ServiceAccountCredential
, Google.Apis.Auth.OAuth2.ComputeCredential
and Google.Apis.Auth.OAuth2.ImpersonatedCredential
are all supported credentials from which you can build a UrlSigner
by calling the appropiate UrlSigner.FromCredential
method overload. Google.Apis.Auth.OAuth2.GoogleCredential
is also supported as long as the underlying credential is one of the supported specific types.
External account credentials are not currently supported for URL signing because it's not always possible to know client side which service account the credential maps back to, and that's a requirement (we would be calling the IAM service internally for this).
I'll discuss internally with the wider Auth team to consider supporting signing with an external account credential in cases where we know the underlying service account. Feel free to create an issue in https://github.com/googleapis/google-api-dotnet-client/issues where I can update back.