Sha256: 05caa515cb15e9abf6f34a7bae5fd1892d2dbd2ba807ba58d374db3cbe5ecc86

Contents?: true

Size: 740 Bytes

Versions: 3

Compression:

Stored size: 740 Bytes

Contents

# Sample app for DrChrono OAuth2 Strategy
# Make sure to setup the ENV variables DRCHRONO_CLIENT_ID and DRCHRONO_CLIENT_SECRET
# Run with "bundle exec rackup"

require 'bundler/setup'
require 'sinatra/base'
require 'omniauth-drchrono'

class App < Sinatra::Base
  get '/' do
    redirect '/auth/drchrono'
  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 :drchrono, ENV['DRCHRONO_CLIENT_ID'], ENV['DRCHRONO_CLIENT_SECRET'], scope: 'user:read'
end

run App.new

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
omniauth-drchrono-oauth2-1.2.0 example/config.ru
omniauth-drchrono-oauth2-1.1.0 example/config.ru
omniauth-drchrono-oauth2-1.0.0 example/config.ru