diff --git a/docs/rails-tutorial.md b/docs/rails-tutorial.md index 8f72abd..544c540 100644 --- a/docs/rails-tutorial.md +++ b/docs/rails-tutorial.md @@ -8,11 +8,12 @@ This tutorial explains how to integrate Auth0 with a Ruby on Rails application. Add the gem to your Gemfile: -``` -gem 'auth0' -``` + gem 'omniauth', '1.2.1' + gem 'omniauth-auth0', '1.0.1' -> This gem is essentially an [Omniauth Strategy](https://github.com/intridea/omniauth/wiki/Strategy-Contribution-Guide). +Then run: + + $ bundle install ### 2. Setting up the callback URL in Auth0 @@ -44,7 +45,7 @@ Create the callback controller rails generate controller auth0 callback -Open the `callback_controller.rb` under the `app/controllers` folder and implement the methods `store` (used to store the user profile in session), and `failure` (to display error messages): +Open the `auth0_controller.rb` under the `app/controllers` folder and implement the method callback as follows: class Auth0Controller < ApplicationController def callback @@ -53,7 +54,9 @@ Open the `callback_controller.rb` under the `app/controllers` folder and impleme end end -Set the callback route in the `routes.rb` under `config` folder: +This stores the user profile in the session. + +Now replace the auto-generated route in routes.rb: get "/auth/auth0/callback" => "auth0#callback" @@ -75,11 +78,11 @@ The userinfo includes these attributes: `uid`, `name`, `email`, `nickname` and `