Hello Google Cloud Community,
I’m experiencing a reproducible issue with Google Cloud X.509 Workload Identity Federation.
Google STS rejects a valid client certificate with the following response:
HTTP 400 — unauthorized_client
“The given credential is rejected by the attribute condition.”
Configuration
Attribute mapping:
google.subject=assertion.san.uri
Attribute condition:
assertion.san.uri == 'spiffe://kiratakip-commerce-dev/website-bff' &&
assertion.sha256Fingerprint == '5KIAb4uCgpRuMDOpl8TJpaN2ft06cJeOW2oO+MDXlT4='
The Workload Identity Pool and X.509 provider are both ACTIVE.
What we’ve verified
-
The certificate’s first URI SAN exactly matches the condition.
-
The SHA-256 certificate fingerprint exactly matches the expected standard Base64 value.
-
The certificate has the correct clientAuth EKU and a valid ECDSA P-256 key.
-
The certificate chain validates against the CA configured in Google’s trust store.
-
The original private key matches the certificate.
-
The mTLS request follows Google’s documented X.509 STS token-exchange format.
Independent reproduction
The identical error occurred through two separate clients:
-
Cloudflare Workers using an outbound mTLS certificate binding.
-
Local Python 3.14.4 with OpenSSL 3.0.19, using the same certificate and private key.
Both received HTTP 400 with the same attribute-condition rejection.
No access tokens were issued.
Questions
-
Is there a known issue or undocumented encoding requirement for
assertion.sha256Fingerprintin X.509 WIF attribute conditions? -
Does Google evaluate
assertion.san.uriandassertion.sha256Fingerprintdifferently from their documented representations? -
Is there a way to determine which individual condition fails during STS evaluation?
-
What is the recommended secure fix without removing either restriction?
Any guidance from Google Cloud engineers or developers who have encountered this issue would be greatly appreciated.
Thank you!