Sha256: 5114fc37960aaff7a4e87baa6ad146fe737f1cbce64269bd45a9755569a42b74

Contents?: true

Size: 566 Bytes

Versions: 6

Compression:

Stored size: 566 Bytes

Contents

require 'rubygems'
require 'bundler'

Bundler.setup :default, :development, :example
require 'sinatra'
require 'omniauth-openid'
require 'openid/store/filesystem'

use Rack::Session::Cookie

use OmniAuth::Builder do
  provider :open_id, store: OpenID::Store::Filesystem.new('/tmp')
end

get '/' do
  <<-HTML
  <ul>
    <li><a href='/auth/open_id'>Sign in with OpenID</a></li>
  </ul>
  HTML
end

[:get, :post].each do |method|
  send method, '/auth/:provider/callback' do
    content_type 'text/plain'
    request.env['omniauth.auth'].info.to_hash.inspect
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
omniauth-openid-2.0.1 examples/sinatra.rb
omniauth-openid-1.0.1 examples/sinatra.rb
omniauth-openid-1.0.0 examples/sinatra.rb
omniauth-openid-1.0.0.rc2 examples/sinatra.rb
omniauth-openid-1.0.0.rc1 examples/sinatra.rb
omniauth-openid-1.0.0.beta1 examples/sinatra.rb