User Authentication and Authorization

You’ve gotten quite far in your example without adding a user model to it, which we’ll rectify now.

We need to get users and passwords into the system without spending too much time in the setup weeds—so you can focus your attention on the security issues that having users causes. To do that, use the Devise gem for basic user authentication and focus on how to use Devise as part of your security and testing goals.[58] (Part of me wants to derive user authentication from first principles, and someday when I publish a book from “The Purist Press” I’ll do that.)

Devise is a big, multifaceted gem, and I’ll only be scratching the surface of what it can do. It handles all kinds of login needs, including confirmation ...

Get Rails 5 Test Prescriptions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.