My adventure in designing API keys
vjay15.github.io
My adventure in designing API keys
1–10 of 88 posts
Re: My adventure in designing API keys
#2Re: My adventure in designing API keys
#3Even the random hex with checksum component seems overkill to me, either the API key is correct or it isn't.
Re: My adventure in designing API keys
#4PS : I too am working on a APIs.Take a look here : https://voiden.md/
Re: My adventure in designing API keys
#5Re: My adventure in designing API keys
#6Re: My adventure in designing API keys
#7Re: My adventure in designing API keys
#8If you want aspects of the token to be inspectable by intermediaries, then you want json web tokens or a similar technology. You do not want to conflate these ideas. JWTs would solve the stated database concern. All you need to store in a JWT scheme are the private/public keys. Explicit tracking of the session is not required.
Re: My adventure in designing API keys
#9I know sometimes people just like to try things out, but for the love of god do not implement encryption related functionality yourself. Use JWT tokens and OpenSSL or another established library to sign them. This problem is solved. Not essentially solved, solved. Creating your own API key system has a high likelihood of fucking things up for good!
Plain old API keys are straightforward to implement. Create a long random string and save it in the DB. When someone connects to the API, check if the API key is in your DB and use that to authenticate them. That's it.
Re: My adventure in designing API keys
#10I know sometimes people just like to try things out, but for the love of god do not implement encryption related functionality yourself. Use JWT tokens and OpenSSL or another established library to sign them. This problem is solved. Not essentially solved, solved. Creating your own API key system has a high likelihood of fucking things up for good!