2

I am designing the database for my own OAuth service. My current solution is to have an 512-bit long access token and save it as binary data in sql. Is this a good practice? Do I need varchar type instead? I am worried about the search time to retrieve the row containing the access token. Thanks!

divyanshm
  • 6,600
  • 7
  • 43
  • 72
user2385629
  • 23
  • 1
  • 4

1 Answers1

0

Correct me if I am missing something, I'll edit right away.

However you are storing the access tokens you never need to run a query on the tokens themselves. You would run a query on the userID or something and fetch the access token for that customer. I say this because the tokens are supposed to contain data that you can extract.

How are you dealing with access tokens?
Do read this question - How would an efficient OAuth2.0 server / provider work?

It discusses how access tokens behave.

Community
  • 1
  • 1
divyanshm
  • 6,600
  • 7
  • 43
  • 72