Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best data length for storing OAuth tokens

I want to write a mysql database schema for storing OAuth access tokens which is sufficiently generic so that it is capable for supporting any provider that complies with the OAuth standard.

What would be a sensible data length to achieve this aim and why? As far as I can see, no maximum length is enforced by the standard and I don't want to have to change my column length whenever I decide to support a new provider that happens to use larger tokens.

If this is not practical/possible, what would be a sensible length for supporting the more popular OAuth providers and why?

CHOSEN SOLUTION

Using a data type with an undefined length seems to be the only sufficiently generic option for my case.

like image 420
Rupert Madden-Abbott Avatar asked Sep 05 '25 13:09

Rupert Madden-Abbott


1 Answers

You can use text data type for this if you don't know the exact length.

like image 179
KillerFish Avatar answered Sep 10 '25 02:09

KillerFish