DEV Community

Cover image for Securing the Rails: User Authentication and Bcrypt in Ruby on Rails

Securing the Rails: User Authentication and Bcrypt in Ruby on Rails

Joshua Mayhew on April 13, 2023

Knowing how to properly safeguard valuable and sensitive data against malicious actors is an especially critical aspect of web development. In an e...
Collapse
 
jhelberg profile image
Joost Helberg

Another way to avoid weak password methods is to use database authentication. The great thing then is that there is no need at all to store any part of the username or password. The other great thing is that the datamodel has no columns for username and password. Just a reference to the database-role. Rdbms-vendors have much better ways to ensure safety of whatever credentials are used, don't try this yourself. Bonus: other clients can access the database without compromising authorization; your ruby-server is no longer a monopoly.