Difference between v1, v2 and v3 in https://www.googleapis.com/oauth2/v3/certs

azizj1

I'm trying to authenticate a user on Android via Google Sign-in to get the account name, grab the token via GoogleAuthUtil.getToken(getApplicationContext(), app, scopes), and then send the token to my NodeJS back-end server to verify

I found this great stackoverflow question on how to decode it, cache the key id (KID) so it's not doing a round trip every time, etc. (haven't implemented this part yet, but sort of played around with it) My only question is: what's the difference between the following googleapis certs:

  • www.googleapis.com/oauth2/v1/certs
  • www.googleapis.com/oauth2/v2/certs
  • www.googleapis.com/oauth2/v3/certs

The KID on each version are identical, but the content is overtly different. Why? v2 and v3 seem to be almost identical except that v2 has an "==" appended at the end of the value of property 'n'

Most importantly, which version do I use?

I think these certs are called JSON Web Keys (JWK). I've also read the term 'x5c' What is that?

PS: The token I'm getting on my nodejs from my android app is:

{
 "iss": "accounts.google.com",
 "sub": "SOME_LONG_NUMBER_THAT_I_DONT_KNOW_IF_SHOULD_SHOW",
 "azp": "SERVER_CLIENT_ID",
 "email": "ANDROID_USER_EMAIL",
 "email_verified": "true",
 "aud": "ANDROID_CLIENT_ID",
 "iat": "SOME_NUMBER",
 "exp": "SOME_NUMBER",
 "alg": "RS256",
 "kid": "e53139984bd36d2c230552441608cc0b5179487a"
}
bjmc

Version 1 appears to be a basic JSON mapping of key ids to certificate strings. I don't have any inside information, but I would speculate that this is a simple "home-grown" format that somebody at Google made up as an easy way to distribute their public keys.

As you have noted, versions 2 and 3 are distributed in the JSON Web Key (JWK) format. This format is defined in a formal specification, RFC 7517, which lays out exactly how to structure a JSON response representing cryptographic keys.

As for the difference between v2 and v3, it looks like v2 included trailing equal signs as padding and in v3 they've simply stripped those off.

I've also read the term 'x5c' What is that?

In the specification, 'x5c' is defined as an optional parameter for specifying a list of cryptographic certificates that together form a "chain of trust" that would allow a client application to validate the key by verifying each certificate in turn and following the chain back to a known, trusted root certificate.

Most importantly, which version do I use?

If possible, I would suggest using the most-current version. But as long as the keys themselves are identical, it probably doesn't matter very much.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Google oauth suddenly fails due to 503 when GAE tries to load https://www.googleapis.com/oauth2/v1/certs

From Dev

How to get the email from https://www.googleapis.com/plus/v1/people/me call using a google+ token?

From Dev

difference between v1 and v2 of Erik's css-reset

From Dev

Routing differences between Kohana v2 and v3

From Dev

Throwable = Malformed URL. Base: https://speech.googleapis.com/v1/, Relative: speech:longrunningrecognize

From Dev

rails routing difference between v3 and V5

From Java

Difference between signature versions - V1 (Jar Signature) and V2 (Full APK Signature) while generating a signed APK in Android Studio?

From Dev

Where to know exactly about the differences between symfony v1 and v2 changes?

From Dev

weird file listing response differences between v2 and v3

From Dev

PayPal v2 Orders API - difference between OrdersGetRequest and OrdersCaptureRequest

From Dev

Class variable V3 dependent on V1 and V2. How to define V3 in children classes

From Dev

Setup two kinect: v1 and v2

From Dev

complex variables in xslt template v1, v2

From Dev

Migrating koa v1 to v2

From Dev

Slim v2 to Slim v3 Upgrade

From Dev

OpenShift V3 vs. OpenShift V2

From Dev

Problems in update Google Analytics v2 to v3

From Dev

Youtube v2 to v3 migration in Android apps

From Dev

Powershell v2 and PowerShell v3 Object handling

From Dev

Having problems with converting pinescript v2 into v3

From Dev

Youtube API v2 update on v3

From Dev

Python: String [ [k1:v1, k2:v2], [k3:v3] ] to Object

From Dev

Angularjs v1 vs v2 and release date for v2

From Dev

Mailchimp API changes v1/2 to v3 for interest groupings

From Dev

Unity3D Linear interpolation from V1 to moving V2

From Dev

Difference between ("v" 1) and ("v" . 1)

From Dev

Switch between panes in Pharo v3

From Dev

HTTPS version 1 vs v2 - differences

From Dev

NGINX with SPDY v2, v3, and v3.1?

Related Related

  1. 1

    Google oauth suddenly fails due to 503 when GAE tries to load https://www.googleapis.com/oauth2/v1/certs

  2. 2

    How to get the email from https://www.googleapis.com/plus/v1/people/me call using a google+ token?

  3. 3

    difference between v1 and v2 of Erik's css-reset

  4. 4

    Routing differences between Kohana v2 and v3

  5. 5

    Throwable = Malformed URL. Base: https://speech.googleapis.com/v1/, Relative: speech:longrunningrecognize

  6. 6

    rails routing difference between v3 and V5

  7. 7

    Difference between signature versions - V1 (Jar Signature) and V2 (Full APK Signature) while generating a signed APK in Android Studio?

  8. 8

    Where to know exactly about the differences between symfony v1 and v2 changes?

  9. 9

    weird file listing response differences between v2 and v3

  10. 10

    PayPal v2 Orders API - difference between OrdersGetRequest and OrdersCaptureRequest

  11. 11

    Class variable V3 dependent on V1 and V2. How to define V3 in children classes

  12. 12

    Setup two kinect: v1 and v2

  13. 13

    complex variables in xslt template v1, v2

  14. 14

    Migrating koa v1 to v2

  15. 15

    Slim v2 to Slim v3 Upgrade

  16. 16

    OpenShift V3 vs. OpenShift V2

  17. 17

    Problems in update Google Analytics v2 to v3

  18. 18

    Youtube v2 to v3 migration in Android apps

  19. 19

    Powershell v2 and PowerShell v3 Object handling

  20. 20

    Having problems with converting pinescript v2 into v3

  21. 21

    Youtube API v2 update on v3

  22. 22

    Python: String [ [k1:v1, k2:v2], [k3:v3] ] to Object

  23. 23

    Angularjs v1 vs v2 and release date for v2

  24. 24

    Mailchimp API changes v1/2 to v3 for interest groupings

  25. 25

    Unity3D Linear interpolation from V1 to moving V2

  26. 26

    Difference between ("v" 1) and ("v" . 1)

  27. 27

    Switch between panes in Pharo v3

  28. 28

    HTTPS version 1 vs v2 - differences

  29. 29

    NGINX with SPDY v2, v3, and v3.1?

HotTag

Archive