Sha256: b45864e2975744eb01a2d115867839362f22b9cee2d51603f0ea8e4db3c8df08

Contents?: true

Size: 608 Bytes

Versions: 4

Compression:

Stored size: 608 Bytes

Contents

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

require 'omniauth-ms-office365'
require 'sinatra'
require 'json'

set :port, 4200

office365_client_id = ENV['OFFICE365_CLIENT_ID']
office365_client_secret = ENV['OFFICE365_CLIENT_SECRET']

use Rack::Session::Cookie
use OmniAuth::Builder do
  provider :office365, office365_client_id, office365_client_secret
end

get '/' do
  "<a href='/auth/office365'>Log in with Office365</a>"
end

get '/auth/office365/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

4 entries across 4 versions & 1 rubygems

Version Path
omniauth-ms-office365-2.0.2 example/example.rb
omniauth-ms-office365-1.0.2 example/example.rb
omniauth-ms-office365-1.0.1 example/example.rb
omniauth-ms-office365-1.0.0 example/example.rb