Sha256: 478b47bcfe167db4e8a9bfa52d4a9e310f3f62516164137b5c2656d2f2948a7c

Contents?: true

Size: 582 Bytes

Versions: 12

Compression:

Stored size: 582 Bytes

Contents

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

require 'microsoft_graph'
require 'sinatra'
require 'json'

set :port, 4200

client_id = ENV['AZURE_APPLICATION_CLIENT_ID']
secret = ENV['AZURE_APPLICATION_CLIENT_SECRET']

use Rack::Session::Cookie
use OmniAuth::Builder do
  provider :microsoft_graph, client_id, secret
end

get '/' do
  "<a href='/auth/microsoft_graph'>Log in with Microsoft</a>"
end

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

get '/auth/failure' do
  content_type 'text/plain'
  params.to_json
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
omniauth-microsoft_graph-2.0.1 example/example.rb
omniauth-microsoft_graph-2.0.0 example/example.rb
omniauth-microsoft_graph-1.2.0 example/example.rb
omniauth-microsoft_graph-1.1.0 example/example.rb
omniauth-microsoft_graph-1.0.0 example/example.rb
omniauth-microsoft_graph-0.3.3 example/example.rb
omniauth-microsoft_graph-0.3.2 example/example.rb
omniauth-microsoft_graph-0.3.1 example/example.rb
omniauth-microsoft_graph-0.3.0 example/example.rb
omniauth-microsoft_graph-0.2.1 example/example.rb
omniauth-microsoft_graph-0.2.0 example/example.rb
omniauth-microsoft_graph-0.1.1 example/example.rb