Library to generate API tokens without database |
You might not have access to a full-fledged database but you could always try using a sqlite backend. Store all of your tokens inside a table in the sqlite file. Use spark command line to manipulate that database for creation/deletion/etc of tokens. When a request comes in, check the for the Bearer token header and compare against your sqlite database, if authorized proceed, if not issue appropriate rejection. If you're referring to something like a JWT the process would be more involved, but for a basic random token you can use any sort of time based uuid or just bin2hex(random_bytes()).
|
Messages In This Thread |
Library to generate API tokens without database - by kabeza - 04-19-2023, 05:21 AM
RE: Library to generate API tokens without database - by grimpirate - 04-19-2023, 03:59 PM
RE: Library to generate API tokens without database - by kabeza - 04-20-2023, 04:11 AM
|