I'm using Google's OpenIDConnect authentication, and I want to validate the JWT id_token
returned from Google. However, the documentation seems inconsistent about what value Google returns for the iss
(issuer) claim in the ID token.
One page says, "iss: always accounts.google.com", but another page says "The value of iss in the ID token is equal to accounts.google.com
or https://accounts.google.com
" and a comment in the example code further explains:
// If you retrieved the token on Android using the Play Services 8.3 API or newer, set
// the issuer to "https://accounts.google.com". Otherwise, set the issuer to
// "accounts.google.com". If you need to verify tokens from multiple sources, build
// a GoogleIdTokenVerifier for each issuer and try them both.
I have a server-side application, not an Android app, so I'm not using Play Services.
To further muddy the waters, the OpenIDConnect specification itself contains a note that:
Implementers may want to be aware that, as of the time of this writing, Google's deployed OpenID Connect implementation issues ID Tokens that omit the required https:// scheme prefix from the iss (issuer) Claim Value. Relying Party implementations wishing to work with Google will therefore need to have code to work around this, until such time as their implementation is updated. Any such workaround code should be written in a manner that will not break at such point Google adds the missing prefix to their issuer values.
That document is dated November 8, 2014. In the time since then, has Google standardized on an iss
value, or do I really need to check for both of them? The comment above seems to indicate that only Play Services >=8.3 gets iss
with https://
, and everywhere else the value will be just accounts.google.com
. Is that true?
issuer-uri
. It's sad that, 4 years after that document date, this is still a problem. – Missus