I'm building out a website (never did full stack before) and am implementing authentication. It's turning out to be more work than I expected. Is it unreasonable to implement auth yourself with JWTs? You also need to setup email sending for verification which takes more time.
dvektor|1 year ago
Personally I think the problem is we are being sold so many 'conveniences'/solutions these days. They want you to think you cannot safely do it yourself, and on top of that, often times it's actually more difficult just to learn how to use whatever API the convenience that's being sold to us, uses.
You are often better off learning what is really happening under the hood, and solving the actual problem, instead of trying to figure out whatever api/tool that is being sold to you as a convenience. EDIT: to clarify, if you are inexperienced: I recommend learning by implementing both session + JWT auth on a side project, before using hand-rolled solutions in production.
replwoacause|1 year ago
deedasmi|1 year ago
chpatrick|1 year ago
stavros|1 year ago
The talk about replacing it is with OAuth2, so the result will be that integrating with any service will be more difficult than writing the entire auth service in the first place, but what can you do.
curtisblaine|1 year ago
*difficult not as in "hard to implement", more as in "lots of moving parts, hard to maintain"
a022311|1 year ago
lelanthran|1 year ago
I've used randomly salted SHA512 to create a stored password. What's wrong with that?
gregopet|1 year ago
rat9988|1 year ago
ab_testing|1 year ago
https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial...
aristofun|1 year ago
Unless you are more experienced and smarter than average engineer working on a 3d party solution - you should build your own only for educational purposes.
notpushkin|1 year ago
[1]: https://boxyhq.com/docs/jackson/overview
yagami_takayuki|1 year ago
You would either use something like Firebase Auth or the built-in one that comes with your framework of choice. Identity in .NET core for example.
On the topic of auth, and as an aside, wondering if anyone has used a UUID + API key combination to do auth instead of JWT/cookies?
latch|1 year ago
Store users with an username/email and scrypt-encrypted password.
On login, pull the encrypted password where username = $1. Compare. If valid, create a session id (fill 16 bytes with a cryptographically secure random number generator and encode it), store it that in the db along the user_id and some expiration time.
You now have a session_id -> user_id mapping which can.
goldname|1 year ago
mhitza|1 year ago
Even better nowadays, there are multiple SaaS/starter kits you can use (most are paid) that remove all these chores and you can get down to your domain flow.
kristiandupont|1 year ago
However, my own experience is that the API's are in fact more complex to deal with than just setting it up yourself. So at least for MVP's, I wouldn't recommend it.
illuminant|1 year ago
You should consider one of the many frameworks that handle this sort of thing for you (every language has them.)
It is unclear from your comment how you might be helped.
pkulak|1 year ago
It was pretty boring and grinding. For a personal site, I’d use something off the shelf for sure.