Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

52 lines (30 sloc) 1.522 kB


Provides strategies for authenticating to providers using the OpenID standard.


To get just OpenID functionality:

gem install oa-openid

For the full auth suite:

gem install omniauth

Stand-Alone Example

Use the strategy as a middleware in your application:

require 'omniauth/openid'
require 'openid/store/filesystem'

use Rack::Session::Cookie
use OmniAuth::Strategies::OpenID,'/tmp')

Then simply direct users to '/auth/open_id' to prompt them for their OpenID identifier. You may also pre-set the identifier by passing an identifier parameter to the URL (Example: /auth/open_id?

A list of all OpenID stores is available at

OmniAuth Builder

If OpenID is one of several authentication strategies, use the OmniAuth Builder:

require 'omniauth/openid'
require 'omniauth/basic'  # for Campfire
require 'openid/store/filesystem'

use OmniAuth::Builder do
  provider :open_id,'/tmp')
  provider :campfire

Configured Identifiers

You may pre-configure an OpenID identifier. For example, to use Google's main OpenID endpoint:

use OmniAuth::Builder do
  provider :open_id, nil, :name => 'google', :identifier => ''

Note the use of nil, which will trigger ruby-openid's default Memory Store.

Jump to Line
Something went wrong with that request. Please try again.