Welcome Guest, Not a member yet? Register   Sign In
Library to generate API tokens without database
#2

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()).
Reply


Messages In This Thread
RE: Library to generate API tokens without database - by grimpirate - 04-19-2023, 03:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB