Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google OAuth 2.0 User id datatype for MYSQL

I'm implementing Google OAuth 2.0 and noticed that the unique user id returned by Google OAuth is 21 digits long. I thought BIGINT(20) would be enough for this need, but I'm confused now on seeing the length of the user id returned by Google OAuth. Any ideas on how I should go about this ?

like image 457
palerdot Avatar asked Oct 16 '13 16:10

palerdot


People also ask

What is ID token in Google OAuth?

The id_token value contains the information about the user's authentication. The ID token resembles the concept of an identity card, in a standard JWT format, signed by the OpenID Provider (OIDP). To obtain one, the client needs to send the user to their OIDP with an authentication request.


1 Answers

For saving the id, you should use varchar, beacuse as the data you are trying to save is from 3rd party, you can't be certain if the value will be numeric only(though google user id is numeric only but the convention is still not in our control).

like image 162
Jhanvi Avatar answered Oct 06 '22 03:10

Jhanvi