Sha256: 90c52da3f0a877ab12b12d1b18968348b28b82dd485dd7e313cbae5a62cb95bc

Contents?: true

Size: 549 Bytes

Versions: 8

Compression:

Stored size: 549 Bytes

Contents

$:.push File.dirname(__FILE__) + '/../lib'

require 'omniauth-azure-oauth2'
require 'sinatra'

class MyAzureProvider
  def self.client_id
    ENV['AZURE_CLIENT_ID']
  end

  def self.client_secret
    ENV['AZURE_CLIENT_SECRET']
  end

  def self.tenant_id
    ENV['AZURE_TENANT_ID']
  end

end

use Rack::Session::Cookie
use OmniAuth::Strategies::Azure, MyAzureProvider

get '/' do
  "<a href='/auth/azure_oauth2'>Log in with Azure</a>"
end

get '/auth/azure_oauth2/callback' do
  content_type 'text/plain'
  request.env['omniauth.auth'].inspect
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
omniauth-azure-oauth2-0.0.10 examples/sinatra.rb
omniauth-azure-oauth2-0.0.9 examples/sinatra.rb
omniauth-azure-oauth2-0.0.8 examples/sinatra.rb
omniauth-azure-oauth2-0.0.6 examples/sinatra.rb
omniauth-azure-oauth2-0.0.5 examples/sinatra.rb
omniauth-azure-oauth2-0.0.4 examples/sinatra.rb
omniauth-azure-oauth2-0.0.3 examples/sinatra.rb
omniauth-azure-oauth2-0.0.2 examples/sinatra.rb