What's the best column type for Google+ User ID?

Viewed 10305

Google+ has very long User IDs

104560124403688998123

(21 characters), which is not possible to input into BIGINT field (not unsigned)

What column type would you use for such IDs ?

I do not think that varchar is good idea

5 Answers

I would recommend a VARCHAR(255) (a variable length string up to 255 characters). The reason is because the id could be a ASCII string that is up to 255 chars long, see reference below.

Google OpenID Connect
"Authenticating the user involves obtaining an ID token and validating it. ID tokens are a standardized feature of OpenID Connect designed for use in sharing identity assertions on the Internet."
OpenID Connect Core 1.0 incorporating errata set 1
sub: (is the google id)
"REQUIRED. Subject Identifier. A locally unique and never reassigned identifier within the Issuer for the End-User, which is intended to be consumed by the Client, e.g., 24400320 or AItOawmwtWwcT0k51BayewNvutrJUqsvl6qs7A4. It MUST NOT exceed 255 ASCII characters in length. The sub value is a case sensitive string."

Related