Sha256: 9590c550977a2c80c9b465f42144ab555525580562e0b5851a94cb1243944c30

Contents?: true

Size: 511 Bytes

Versions: 4

Compression:

Stored size: 511 Bytes

Contents

require 'rubygems'
require 'bundler'

Bundler.setup :default, :development, :example
require 'sinatra'
require 'omniauth'
require 'omniauth-vkontakte'

use Rack::Session::Cookie

use OmniAuth::Builder do
  provider :vkontakte,  ENV['VKONTAKTE_KEY'], ENV['VKONTAKTE_SECRET']
end

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

get '/auth/:provider/callback' do
  content_type 'text/plain'
  request.env['omniauth.auth'].info.to_hash.inspect
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
omniauth-vkontakte-1.0.4 examples/sinatra.rb
omniauth-vkontakte-1.0.3 examples/sinatra.rb
omniauth-vkontakte-1.0.2 examples/sinatra.rb
omniauth-vkontakte-1.0.1 examples/sinatra.rb