Sha256: 958e14884166f820ca95c79e2734c7c96d716a8ca473f2588b24205e1f85cc69

Contents?: true

Size: 701 Bytes

Versions: 8

Compression:

Stored size: 701 Bytes

Contents

# Sample app for LinkedIn OAuth2 Strategy
# Make sure to setup the ENV variables LINKEDIN_KEY and LINKEDIN_SECRET
# Run with "bundle exec rackup"

require 'bundler/setup'
require 'sinatra/base'
require 'omniauth-linkedin-oauth2'

class App < Sinatra::Base
  get '/' do
    redirect '/auth/linkedin'
  end

  get '/auth/:provider/callback' do
    content_type 'application/json'
    MultiJson.encode(request.env['omniauth.auth'])
  end

  get '/auth/failure' do
    content_type 'application/json'
    MultiJson.encode(request.env)
  end
end

use Rack::Session::Cookie, :secret => 'change_me'

use OmniAuth::Builder do
  provider :linkedin, ENV['LINKEDIN_KEY'], ENV['LINKEDIN_SECRET']
end

run App.new

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
omniauth-linkedin-oauth2-1.0.1 example/config.ru
omniauth-linkedin-oauth2-1.0.0 example/config.ru
omniauth-linkedin-oauth2-cwd-0.1.5 example/config.ru
omniauth-linkedin-oauth2-0.2.5 example/config.ru
omniauth-linkedin-oauth2-0.1.5 example/config.ru
omniauth-linkedin-oauth2-0.1.4 example/config.ru
omniauth-linkedin-oauth2-0.1.3 example/config.ru
omniauth-linkedin-oauth2-0.1.2 example/config.ru