Compare commits
4 Commits
add-guardi
...
microsoft-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb7f8f1a43 | ||
|
|
190ff2854b | ||
|
|
8214ba9e67 | ||
|
|
9cbd8d31a8 |
@@ -16,9 +16,10 @@ REDIS_URL=
|
|||||||
# Required for Zoom.us integration
|
# Required for Zoom.us integration
|
||||||
ZOOM_API_KEY=
|
ZOOM_API_KEY=
|
||||||
ZOOM_API_SECRET=
|
ZOOM_API_SECRET=
|
||||||
|
ZOOM_ACCOUNT_NUMBER=
|
||||||
ZOOM_PRO_USERS_LIMIT= # defaults to 3
|
ZOOM_PRO_USERS_LIMIT= # defaults to 3
|
||||||
ZOOM_USER_TYPE= # 'pro' / 'basic'
|
ZOOM_USER_TYPE= # 'pro' / 'basic'
|
||||||
ZOOM_ENABLE_RECORDINGS=0 # 0 / 1
|
ZOOM_ENABLE_RECORDINGS= # true / false (default: false)
|
||||||
# Token for webhooks authorization
|
# Token for webhooks authorization
|
||||||
ZOOM_VERIFICATION_TOKEN=
|
ZOOM_VERIFICATION_TOKEN=
|
||||||
|
|
||||||
|
|||||||
4
Gemfile
4
Gemfile
@@ -139,6 +139,10 @@ gem 'rack-cors'
|
|||||||
# Ruby wrappers for the HubSpot REST API
|
# Ruby wrappers for the HubSpot REST API
|
||||||
gem "hubspot-ruby"
|
gem "hubspot-ruby"
|
||||||
|
|
||||||
|
# authenticate via Microsoft
|
||||||
|
# gem 'omniauth-microsoft_graph', git: 'https://github.com/m4c3/omniauth-microsoft_graph'
|
||||||
|
gem 'omniauth-microsoft_graph'
|
||||||
|
|
||||||
group :development, :test, :review do
|
group :development, :test, :review do
|
||||||
# Call "byebug" anywhere in the code to stop execution and get a debugger console
|
# Call "byebug" anywhere in the code to stop execution and get a debugger console
|
||||||
gem "byebug", "~> 11.0.1", platforms: [:mri, :mingw, :x64_mingw]
|
gem "byebug", "~> 11.0.1", platforms: [:mri, :mingw, :x64_mingw]
|
||||||
|
|||||||
18
Gemfile.lock
18
Gemfile.lock
@@ -220,6 +220,7 @@ GEM
|
|||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
hashdiff (1.0.1)
|
hashdiff (1.0.1)
|
||||||
hashery (2.1.2)
|
hashery (2.1.2)
|
||||||
|
hashie (4.1.0)
|
||||||
hexapdf (0.9.3)
|
hexapdf (0.9.3)
|
||||||
cmdparse (~> 3.0, >= 3.0.3)
|
cmdparse (~> 3.0, >= 3.0.3)
|
||||||
geom2d (~> 0.2)
|
geom2d (~> 0.2)
|
||||||
@@ -297,6 +298,7 @@ GEM
|
|||||||
money (~> 6.13.2)
|
money (~> 6.13.2)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
msgpack (1.3.1)
|
msgpack (1.3.1)
|
||||||
|
multi_json (1.15.0)
|
||||||
multi_xml (0.6.0)
|
multi_xml (0.6.0)
|
||||||
multipart-post (2.1.1)
|
multipart-post (2.1.1)
|
||||||
nio4r (2.5.2)
|
nio4r (2.5.2)
|
||||||
@@ -308,6 +310,21 @@ GEM
|
|||||||
warden
|
warden
|
||||||
oath-generators (1.0.1)
|
oath-generators (1.0.1)
|
||||||
oath (>= 0.0.12)
|
oath (>= 0.0.12)
|
||||||
|
oauth2 (1.4.4)
|
||||||
|
faraday (>= 0.8, < 2.0)
|
||||||
|
jwt (>= 1.0, < 3.0)
|
||||||
|
multi_json (~> 1.3)
|
||||||
|
multi_xml (~> 0.5)
|
||||||
|
rack (>= 1.2, < 3)
|
||||||
|
omniauth (1.9.1)
|
||||||
|
hashie (>= 3.4.6)
|
||||||
|
rack (>= 1.6.2, < 3)
|
||||||
|
omniauth-microsoft_graph (0.3.3)
|
||||||
|
omniauth (~> 1.1, >= 1.1.1)
|
||||||
|
omniauth-oauth2 (~> 1.6)
|
||||||
|
omniauth-oauth2 (1.6.0)
|
||||||
|
oauth2 (~> 1.1)
|
||||||
|
omniauth (~> 1.9)
|
||||||
parallel (1.19.1)
|
parallel (1.19.1)
|
||||||
parity (3.2.0)
|
parity (3.2.0)
|
||||||
parser (2.6.5.0)
|
parser (2.6.5.0)
|
||||||
@@ -552,6 +569,7 @@ DEPENDENCIES
|
|||||||
mux_ruby!
|
mux_ruby!
|
||||||
oath (~> 1.1.0)
|
oath (~> 1.1.0)
|
||||||
oath-generators (~> 1.0.1)
|
oath-generators (~> 1.0.1)
|
||||||
|
omniauth-microsoft_graph
|
||||||
parity (~> 3.2.0)
|
parity (~> 3.2.0)
|
||||||
pdf-reader (~> 2.1.0)
|
pdf-reader (~> 2.1.0)
|
||||||
pdfkit (~> 0.8.2)
|
pdfkit (~> 0.8.2)
|
||||||
|
|||||||
10
app/controllers/callbacks_controller.rb
Normal file
10
app/controllers/callbacks_controller.rb
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
class CallbacksController < ApplicationController
|
||||||
|
skip_before_action :require_login
|
||||||
|
skip_after_action :verify_authorized, except: :index
|
||||||
|
skip_after_action :verify_policy_scoped, only: :index
|
||||||
|
skip_before_action :verify_authenticity_token
|
||||||
|
|
||||||
|
def create
|
||||||
|
render plain: params.inspect
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -15,7 +15,7 @@ class AppHost
|
|||||||
end
|
end
|
||||||
|
|
||||||
def domain_with_port
|
def domain_with_port
|
||||||
[domain, port].compact.join(":")
|
[domain, port].reject(&:blank?).compact.join(":")
|
||||||
end
|
end
|
||||||
|
|
||||||
def protocol
|
def protocol
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
<%= @user.role_for(Current.account).to_s.titleize %>
|
<%= @user.role_for(Current.account).to_s.titleize %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
|
<%= link_to 'Auth to Microsoft', '/auth/microsoft_graph', class: "btn btn-primary" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
|
|||||||
20
config/initializers/omniauth.rb
Normal file
20
config/initializers/omniauth.rb
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
ENV['AZURE_CLIENT_ID'] = 'c45b93ae-ef07-415d-b13a-ab566b877c1c'
|
||||||
|
ENV['AZURE_CLIENT_SECRET'] = 'XVboF2sRaS_H2oK6I9R56.A_exnRhiv~Xt'
|
||||||
|
ENV['AZURE_TENANT_ID'] = '1e33d1c7-dfb4-4df1-86da-62770313bcb0'
|
||||||
|
ENV['AZURE_EXTENSIONS'] = ''
|
||||||
|
|
||||||
|
# Rails.application.config.middleware.use OmniAuth::Builder do
|
||||||
|
# provider :microsoft_graph,{
|
||||||
|
# client_id: ENV['AZURE_CLIENT_ID'],
|
||||||
|
# client_secret: ENV['AZURE_CLIENT_SECRET'],
|
||||||
|
# tenant_id: ENV['AZURE_TENANT_ID'],
|
||||||
|
# extensions: ENV['AZURE_EXTENSIONS'],
|
||||||
|
# redirect_uri: 'https://517e57c6cd6c.ngrok.io/auth/microsoft_graph/callback',
|
||||||
|
# scope: 'openid email profile User.Read'
|
||||||
|
# }
|
||||||
|
# end
|
||||||
|
|
||||||
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
||||||
|
provider :microsoft_graph, ENV['AZURE_CLIENT_ID'], ENV['AZURE_CLIENT_SECRET'], scope: 'openid email profile User.Read'
|
||||||
|
end
|
||||||
|
|
||||||
@@ -4,6 +4,8 @@ require 'sidekiq/web'
|
|||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
AVAILABLE_LOCALES_REGEX = /#{I18n.available_locales.join("|")}/.freeze
|
AVAILABLE_LOCALES_REGEX = /#{I18n.available_locales.join("|")}/.freeze
|
||||||
|
|
||||||
|
get 'auth/microsoft_graph/callback', to: 'callbacks#create'
|
||||||
|
|
||||||
concern :confirmable do
|
concern :confirmable do
|
||||||
resources :video_release_confirmations, only: [:new, :create, :destroy]
|
resources :video_release_confirmations, only: [:new, :create, :destroy]
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user