Quantcast
Viewing all articles
Browse latest Browse all 10

8 Steps to your first OpenID enabled app

openid_login_generator isn’t the only game in town for creating an OpenID-enabled Rails application, and it’s certainly not the best for real-world apps. But it is the simplest. The generator doesn’t even generate migrations for you, yet it’s only 8 steps to your first OpenID enabled app (ok, you had to install ruby, rails and sqlite3 first). Here’s a cheat sheet length tutorial.

$ rails your_app -d sqlite3; cd your_app
$ sudo gem install openid_login_generator -y
$ script/generate openid_login openid_account
$ ${EDITOR} app/controllers/application.rb
  require_dependency "openid_login_system"

  class ApplicationController < ActionController::Base
    include OpenidLoginSystem
    model :user
$ script/generate migration create_user_model
$ ${EDITOR} db/migrate/001_create_user_model.rb
  def self.up
    create_table :users do |t|
         t.column Image may be NSFW.
Clik here to view.
:o
penid_url, :string end end def self.down drop_table :users end $ rake db:migrate $ script/server

Now browse to http://localhost:3000/openid_account/login and test your new openid login-enabled app. You’re good and ready to add “before_filter :login_required” to controllers to limit access. See the readme for more.


Viewing all articles
Browse latest Browse all 10

Trending Articles