Learning Devise for Rails
|Also available on:|
- Use Devise to implement an e-mail-based sign-in process in a few minutes
- Override Devise controllers to allow username-based sign-ins, and customize default Devise HTML views to change the look and feel of the authentication system
- Test your authentication codes to ensure stability
Table of ContentsPreface
Chapter 1: Devise – Authentication Solution for Ruby on Rails
Chapter 2: Authenticating Your Application with Devise
Chapter 3: Privileges
Chapter 4: Remote Authentication with Devise and OmniAuth
Chapter 5: Testing Devise
- Chapter 1: Devise – Authentication Solution for Ruby on Rails
- Devise modules
- Run your first application with Devise
- Chapter 2: Authenticating Your Application with Devise
- Signing in using authentication other than e-mails
- Updating the user account
- Signing up the user with confirmation
- Resetting your password
- Canceling your account
- Customizing Devise actions and routes
- Customizing your Devise layout
- Integrating Devise with Mongoid
- Chapter 3: Privileges
- CollabBlogs – a web application for collaborative writing
- Advanced CanCan usages
- Defining rules using SQL
- Simplifying authorization checks on controllers
- Ensuring abilities' correctness
- Chapter 4: Remote Authentication with Devise and OmniAuth
- Remote authentication
- Implementing remote authentication in our application
- Preparing your application
- Remote authentication using Twitter
- Registering our application at the Twitter developer site
- Configuring OmniAuth for authentication using Twitter
- Remote authentication using Facebook
- Registering our application at the Facebook developer site
- Configuring OmniAuth for authentication using Facebook
- Chapter 5: Testing Devise
- The sign-up test
- The user update test
- The user deletion test
- The sign-in test
- The Remote authentication test
Download the code and support files for this book.
Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.
What you will learn from this book
- Understand Devise as a flexible and customizable authentication solution for Rails
- Customize sign-in, sign-up, password reset, email confirmation, account cancellation, and user account edit pages
- Hide and show views based on defined user authorization rules using CanCan view helpers
- Configure OmniAuth to make user sign-ins and sign-ups via social network accounts work on your Rails application
- Use CanCan abilities to implement simple and SQL-based user privileges to restrict user access
- Test authentications to ensure code stability
There are numerous ways of implementing user sign-ins on your Rails web applications. Of those different ways, using Devise is one of the most popular, quick and flexible way to get user sign-ins working. It is extensible and plays well with other gems such as CanCan (for user privileges) and OmniAuth (for Facebook and Twitter sign-ins).
A hands-on, all-in-one guide that gives you step-by-step instructions along with code examples to implement authentication systems in your application. This book will help you to implement various schemes of authentication systems including authorization and remote authentication, using Devise.
Helping you make your Rails applications more accessible and user-friendly; this book explains how to implement user sign-ins in Rails. It will also show you how to customize user authentication pages, such as sign-in, sign-up, forgot password, and account details, by making use of existing Devise views. In addition, you will learn about facilitating complex privilege rules using the CanCan gem. Finally, you will discover how to make sure your authentication codes work as expected by using integration tests.
You will learn all you need to know to create user email and social network sign-ins quickly, to customize user sign-in-related views, and implement complex privileges, as well as to ensure the stability of your authentication codes by testing them.
A hands-on, step-by-step guide to using Devise for authentication in Rails.
Who this book is for
If you are a web developer who is getting started with Rails and you are looking for authentication solutions, then this is the book for you. If you are a current Rails developer who is looking to extend your authentication implementation with capabilities such as authorization and remote authentication, this book will also be great for you.