What are the best practices for implementing authentication without doing it all from scratch?

0
14
Asked By CleverCactus84 On

I'm relatively new to web development and currently working with TypeScript, Node, Express, and React. Historically, I've followed tutorials that lead me to use methods like JWT and bcrypt for authentication, manually validating everything. However, I'd like to understand how to implement authentication in a secure way without defaulting to 'login with Google', which I didn't find satisfactory in a previous tutorial. People often warn against rolling your own authentication, so I want to know what knowledge or techniques I should master to ensure secure and proper authentication for a small application.

5 Answers

Answered By TechSavvyTiger99 On

It's totally acceptable to implement your own authentication as long as you understand what you're doing. Consider researching OWASP guidelines for insights on secure authentication practices. Building a small project to test out your own implementation can also provide valuable experience.

Answered By CuriousDev22 On

You can certainly roll your own authentication if you're careful not to create your own hashing methods. At its core, authentication can be pretty straightforward—you can generate a hash, store it, and compare it. Just remember, authorization can get a bit more complex, especially depending on your app's requirements.

Answered By WiseNinja13 On

Remember that "don't roll your own auth" doesn't mean you can't implement your own. It just suggests you should rely on established libraries where available. If you do decide to build your own system, make sure it follows basic security principles and practices.

Answered By SunnyCoder47 On

The key point is to avoid rolling your own encryption, particularly for things like password hashing. Use established libraries such as bcrypt for this purpose. If you're looking for an all-in-one solution, services like Auth0 or Keycloak can handle all authentication for you. Alternatively, you can mix and match different auth libraries based on your needs.

Answered By BrightWanderer15 On

When people say 'don't roll your own auth', they usually mean either to let a third-party handle your authentication entirely or to avoid creating your own cryptographic algorithms. Follow standard practices; use well-tested hashing algorithms and adhere to cookie and browser security guidelines.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.