sso_openid 7.2.4.auth0.uat.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +30 -0
- data/app/assets/javascripts/sso_openid/application.js +13 -0
- data/app/assets/stylesheets/sso_openid/application.css +15 -0
- data/app/controllers/sso_openid/sessions_controller.rb +62 -0
- data/app/helpers/sso_openid/application_helper.rb +44 -0
- data/app/views/layouts/sso_openid/application.html.erb +14 -0
- data/config/initializers/omniauth.rb +5 -0
- data/config/routes.rb +7 -0
- data/lib/sso_openid/engine.rb +18 -0
- data/lib/sso_openid/middleware.rb +23 -0
- data/lib/sso_openid/paths.rb +29 -0
- data/lib/sso_openid/spec_helpers.rb +39 -0
- data/lib/sso_openid/urls.rb +48 -0
- data/lib/sso_openid/urls.yml +148 -0
- data/lib/sso_openid/version.rb +3 -0
- data/lib/sso_openid.rb +47 -0
- data/lib/tasks/sso_openid_tasks.rake +4 -0
- metadata +281 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 951f5252674f4168471106eb572626a0cbe271ab101534286c199b2cb549c56c
|
4
|
+
data.tar.gz: 0deb158ec45aaa814120de965169d1b936bbc29708a1ad0ca1992eb17b21ff88
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5462365bfc2a5e813dcbd12621d23a5d2e4230e00136b766682f1d6231875e4366ac50b23b9e88088a2bf3a9c61ea4cba9d16c9c459bca909f1bcf6a4d6b3ab1
|
7
|
+
data.tar.gz: 79d4402e912c1127fc1d8fa44d43f21086ab9d4fb4d512b8f44cb669ec45552a9a5658546d2581b599cb3ea6a2ca77697a13906a2429dffafd16d2eb583afcd9
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2016 Timothy King
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'SsoOpenid'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
load 'rails/tasks/statistics.rake'
|
21
|
+
|
22
|
+
require 'rspec/core'
|
23
|
+
require 'rspec/core/rake_task'
|
24
|
+
|
25
|
+
Bundler::GemHelper.install_tasks
|
26
|
+
|
27
|
+
desc "Run all specs in spec directory (excluding plugin specs)"
|
28
|
+
RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare')
|
29
|
+
|
30
|
+
task :default => :spec
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module SsoOpenid
|
2
|
+
class SessionsController < ::ApplicationController
|
3
|
+
include Rails.application.routes.url_helpers
|
4
|
+
|
5
|
+
skip_before_action :authenticate_admin!, raise: false
|
6
|
+
skip_before_action :verify_authenticity_token, only: [:create, :setup], raise: false
|
7
|
+
|
8
|
+
def create
|
9
|
+
omniauth_data = request.env['omniauth.auth']
|
10
|
+
admin = Admin.from_omniauth(omniauth_data, request.subdomain, request.ip)
|
11
|
+
if admin.nil?
|
12
|
+
failure
|
13
|
+
else
|
14
|
+
if admin.respond_to?(:restrict_access?) && admin.restrict_access?
|
15
|
+
flash[:error] = "You don't have permission to access this site."
|
16
|
+
failure
|
17
|
+
elsif admin.respond_to?(:status) && admin.status != 'active'
|
18
|
+
flash[:error] = "You cannot access this site. Your account has been disabled."
|
19
|
+
failure
|
20
|
+
else
|
21
|
+
sso_openid_sign_in(admin)
|
22
|
+
flash[:notice] = "You have logged in successfully."
|
23
|
+
redirect_to sso_openid_after_sign_in_path
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def destroy
|
29
|
+
sso_openid_sign_out
|
30
|
+
redirect_to sso_openid_after_sign_out_path, allow_other_host: true
|
31
|
+
end
|
32
|
+
|
33
|
+
def failure
|
34
|
+
redirect_to sso_openid_failure_path, allow_other_host: true
|
35
|
+
end
|
36
|
+
|
37
|
+
def setup
|
38
|
+
# Set the redirect uri
|
39
|
+
redirect_uri = sso_openid.callback_url(subdomain: request.subdomain, host: request.host, port: request.port)
|
40
|
+
omniauth_strategy.options[:client_options][:redirect_uri] = redirect_uri
|
41
|
+
Rails.logger.info "sso_openid: setting redirect_uri to #{redirect_uri}"
|
42
|
+
|
43
|
+
# Set additional options if they're available as query strings
|
44
|
+
omniauth_strategy.options[:login_hint] = params[:login_hint] if params[:login_hint].present?
|
45
|
+
omniauth_strategy.options[:acr_values] = "activated:#{params[:activated]}" if params[:activated].present?
|
46
|
+
omniauth_strategy.options[:acr_values] = "pwdReset:#{params[:pwdReset]}" if params[:pwdReset].present?
|
47
|
+
|
48
|
+
# All finished!
|
49
|
+
render plain: "Omniauth setup phase.", status: 200
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def omniauth_strategy
|
55
|
+
@omniauth_strategy ||= request.env['omniauth.strategy']
|
56
|
+
end
|
57
|
+
|
58
|
+
def current_donor
|
59
|
+
nil
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module SsoOpenid
|
2
|
+
module ApplicationHelper
|
3
|
+
def sso_openid_sign_in(admin, options = {})
|
4
|
+
store_in_session = options.key?(:store) ? options[:store] : true
|
5
|
+
if store_in_session
|
6
|
+
session[:admin_uid] = admin.uid
|
7
|
+
session[:admin_id] = admin.id
|
8
|
+
end
|
9
|
+
after_sso_sign_in_call_back
|
10
|
+
@current_admin = admin
|
11
|
+
end
|
12
|
+
|
13
|
+
def sso_openid_sign_out
|
14
|
+
session.delete(:admin_uid)
|
15
|
+
session.delete(:admin_id)
|
16
|
+
reset_session
|
17
|
+
end
|
18
|
+
|
19
|
+
def after_sso_sign_in_call_back
|
20
|
+
# This can be overridden in the including application
|
21
|
+
# to run processes after a user successfully signs in.
|
22
|
+
end
|
23
|
+
|
24
|
+
def current_admin
|
25
|
+
return @current_admin if @current_admin
|
26
|
+
return nil if session[:admin_uid].nil?
|
27
|
+
@current_admin = ::Admin.find_by(uid: session[:admin_uid], id: session[:admin_id])
|
28
|
+
end
|
29
|
+
|
30
|
+
def authenticate_admin!
|
31
|
+
if current_admin.present?
|
32
|
+
return true
|
33
|
+
else
|
34
|
+
#use fullpath instead of path as fullpath includes the query params that are passed in
|
35
|
+
session[:stored_location] = request.fullpath
|
36
|
+
redirect_to sso_openid.auth_path
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def stored_location
|
41
|
+
session.delete(:stored_location)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>SsoOpenid</title>
|
5
|
+
<%= stylesheet_link_tag "sso_openid/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "sso_openid/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
SsoOpenid::Engine.routes.draw do
|
2
|
+
get SsoOpenid::Paths.callback_path => "sessions#create", as: :callback
|
3
|
+
get SsoOpenid::Paths.setup_path => "sessions#setup", as: :setup
|
4
|
+
get SsoOpenid::Paths.auth_path => "sessions#new", as: :auth
|
5
|
+
get SsoOpenid::Paths.failure_path => "sessions#failure", as: :failure
|
6
|
+
get '/admin/sign_out' => 'sessions#destroy', as: :destroy_admin_session
|
7
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module SsoOpenid
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace SsoOpenid
|
4
|
+
|
5
|
+
initializer "sso_openid_mount_engine", before: :load_config_initializers do |app|
|
6
|
+
Rails.application.routes.prepend do
|
7
|
+
mount SsoOpenid::Engine, at: "/"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
config.to_prepare do
|
12
|
+
ActiveSupport.on_load :action_controller do
|
13
|
+
include SsoOpenid::ApplicationHelper
|
14
|
+
helper SsoOpenid::ApplicationHelper
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module SsoOpenid
|
2
|
+
class Middleware
|
3
|
+
attr_accessor :app
|
4
|
+
|
5
|
+
def initialize(app)
|
6
|
+
self.app = app
|
7
|
+
end
|
8
|
+
|
9
|
+
def call(env)
|
10
|
+
request = Rack::Request.new(env)
|
11
|
+
sso_openid_auth_path_prefix = SsoOpenid::Paths.auth_path_prefix
|
12
|
+
Rails.logger.info "Middleware: Request path: #{request.path}"
|
13
|
+
if request.path =~ %r{#{sso_openid_auth_path_prefix}/?}
|
14
|
+
omniauth_strategy = OmniAuth::Strategies::OpenIDConnect.new(app, SsoOpenid::Configuration.openid_options)
|
15
|
+
status, headers, response = omniauth_strategy.call(env)
|
16
|
+
return [status, headers, response]
|
17
|
+
else
|
18
|
+
status, headers, response = app.call(env)
|
19
|
+
return [status, headers, response]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module SsoOpenid
|
2
|
+
class Paths
|
3
|
+
class << self
|
4
|
+
def auth_path_prefix
|
5
|
+
"/admin/auth"
|
6
|
+
end
|
7
|
+
|
8
|
+
def provider_name
|
9
|
+
"sso-openid"
|
10
|
+
end
|
11
|
+
|
12
|
+
def auth_path
|
13
|
+
"#{auth_path_prefix}/#{provider_name}"
|
14
|
+
end
|
15
|
+
|
16
|
+
def callback_path
|
17
|
+
"#{auth_path}/callback"
|
18
|
+
end
|
19
|
+
|
20
|
+
def failure_path
|
21
|
+
"/auth/failure"
|
22
|
+
end
|
23
|
+
|
24
|
+
def setup_path
|
25
|
+
"#{auth_path}/setup"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module SsoOpenid
|
2
|
+
module SpecHelpers
|
3
|
+
def sso_openid_omniauth_stub_for(admin)
|
4
|
+
OmniAuth.config.test_mode = true
|
5
|
+
|
6
|
+
OmniAuth.config.mock_auth[:sso_openid] = OmniAuth::AuthHash.new({
|
7
|
+
provider: 'sso-openid',
|
8
|
+
uid: '379bbf97-d3d9-4206-97a8-c24421b6f4fa',
|
9
|
+
info: {
|
10
|
+
name: nil,
|
11
|
+
email: admin.email,
|
12
|
+
nickname: nil,
|
13
|
+
first_name: "John",
|
14
|
+
last_name: "Doe",
|
15
|
+
gender: nil,
|
16
|
+
image: nil,
|
17
|
+
phone: nil,
|
18
|
+
urls: nil
|
19
|
+
},
|
20
|
+
credentials: {
|
21
|
+
id_token: 'asdf1234',
|
22
|
+
token: 'qwer5678',
|
23
|
+
refresh_token: nil,
|
24
|
+
expires_in: 1800,
|
25
|
+
scope: nil,
|
26
|
+
},
|
27
|
+
extra: {
|
28
|
+
email: admin.email,
|
29
|
+
email_verified: "true",
|
30
|
+
family_name: "John",
|
31
|
+
given_name: "Doe",
|
32
|
+
preferred_username: admin.email,
|
33
|
+
sub: "379bbf97-d3d9-4206-97a8-c24421b6f4fa" ,
|
34
|
+
updated_at: 1462568750
|
35
|
+
}
|
36
|
+
})
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'ostruct'
|
2
|
+
|
3
|
+
module SsoOpenid
|
4
|
+
class Urls
|
5
|
+
|
6
|
+
# Provides a list of the NFG applications by url for environment
|
7
|
+
# in which the containing application is running
|
8
|
+
# The list of urls can by found in the urls.yml file.
|
9
|
+
|
10
|
+
# Calling SsoOpenid.Urls.<name of application> will return the host
|
11
|
+
# value of that application. i.e SsoOpenid.Urls.evo returns the EVO
|
12
|
+
# host for the appropriate env
|
13
|
+
|
14
|
+
|
15
|
+
def self.[](app_name)
|
16
|
+
urls_for_current_environment[app_name]
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.method_missing(method_name, *arguments, &block)
|
20
|
+
# returns the host. If you need a value other than the host
|
21
|
+
# use the hash method above
|
22
|
+
if urls_for_current_environment[method_name]
|
23
|
+
::OpenStruct.new(urls_for_current_environment[method_name])
|
24
|
+
else
|
25
|
+
super
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.reset!
|
30
|
+
# allows us to clear the list and have it be recreated
|
31
|
+
@urls_for_current_environment = nil
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def self.urls_for_current_environment
|
37
|
+
return @urls_for_current_environment if @urls_for_current_environment
|
38
|
+
url_list = YAML::load(ERB.new(IO.read(File.join(File.dirname(__FILE__), 'urls.yml'))).result)
|
39
|
+
url_list_hash = HashWithIndifferentAccess.new(url_list)
|
40
|
+
if !url_list_hash[Rails.env].nil?
|
41
|
+
@urls_for_current_environment = url_list_hash[:defaults].deep_merge(url_list_hash[Rails.env])
|
42
|
+
else
|
43
|
+
@urls_for_current_environment = url_list_hash[:defaults]
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -0,0 +1,148 @@
|
|
1
|
+
defaults:
|
2
|
+
auctions:
|
3
|
+
host: "auctions.networkforgood-beta.com"
|
4
|
+
fqdn: "https://api.auctions.networkforgood-beta.com"
|
5
|
+
sso_openid:
|
6
|
+
host: "dev-auth.dev.bonterralabs.io"
|
7
|
+
fqdn: "https://dev-auth.dev.bonterralabs.io"
|
8
|
+
discovery_endpoint: "https://dev-auth.dev.bonterralabs.io"
|
9
|
+
portal:
|
10
|
+
host: "account.networkforgood-beta.com"
|
11
|
+
fqdn: "https://account.networkforgood-beta.com"
|
12
|
+
identity_users:
|
13
|
+
host: "users-uat.networkforgood.org"
|
14
|
+
fqdn: "https://users-uat.networkforgood.org"
|
15
|
+
dms:
|
16
|
+
host: "dm.networkforgood-beta.com"
|
17
|
+
fqdn: "https://sso.dm.networkforgood-beta.com"
|
18
|
+
evo:
|
19
|
+
host: "networkforgood-beta.com"
|
20
|
+
fqdn: "https://api.networkforgood-beta.com"
|
21
|
+
gp:
|
22
|
+
host: "users-uat.networkforgood.org"
|
23
|
+
users_api: "https://users-uat.networkforgood.org"
|
24
|
+
dashboard: "https://account-uat.networkforgood.org/Npo/Dashboard.aspx"
|
25
|
+
disbursements: "https://account-uat.networkforgood.org/Npo/AccountManagement/OrganizationInfo.aspx"
|
26
|
+
test:
|
27
|
+
auctions:
|
28
|
+
host: "portal.lvh.me:3004"
|
29
|
+
fqdn: "http://portal.lvh.me:3004"
|
30
|
+
dms:
|
31
|
+
host: "dm.n4g.be:3001"
|
32
|
+
fqdn: "http://dev.dm.n4g.be:3001"
|
33
|
+
evo:
|
34
|
+
host: "n4g.be:3000"
|
35
|
+
fqdn: "http://basic.n4g.be:3000"
|
36
|
+
development:
|
37
|
+
auctions:
|
38
|
+
host: "auctions.test"
|
39
|
+
fqdn: "http://dev.auctions.test"
|
40
|
+
portal:
|
41
|
+
host: "portal.test"
|
42
|
+
fqdn: "http://account.portal.test"
|
43
|
+
dms:
|
44
|
+
host: "dm.dm.test"
|
45
|
+
fqdn: "http://dev.dm.dm.test"
|
46
|
+
evo:
|
47
|
+
host: "fp.test"
|
48
|
+
fqdn: "http://basic.fp.test"
|
49
|
+
demo:
|
50
|
+
auctions:
|
51
|
+
host: "auctions.networkforgood-demo.com"
|
52
|
+
fqdn: "https://api.auctions.networkforgood-demo.com"
|
53
|
+
sso_openid:
|
54
|
+
host: "identity-sandbox.networkforgood.org"
|
55
|
+
fqdn: "https://identity-sandbox.networkforgood.org"
|
56
|
+
discovery_endpoint: "https://identity-sandbox.networkforgood.org"
|
57
|
+
portal:
|
58
|
+
host: "account.networkforgood-demo.com"
|
59
|
+
fqdn: "https://account.networkforgood-demo.com"
|
60
|
+
identity_users:
|
61
|
+
host: "users-sandbox.networkforgood.org"
|
62
|
+
fqdn: "https://users-sandbox.networkforgood.org"
|
63
|
+
dms:
|
64
|
+
host: "dm.networkforgood-demo.com"
|
65
|
+
fqdn: "https://sso.dm.networkforgood-demo.com"
|
66
|
+
evo:
|
67
|
+
host: "networkforgood-demo.com"
|
68
|
+
fqdn: "https://api.networkforgood-demo.com"
|
69
|
+
gp:
|
70
|
+
host: "users-sandbox.networkforgood.org"
|
71
|
+
users_api: "https://users-sandbox.networkforgood.org"
|
72
|
+
dashboard: "https://account-sandbox.networkforgood.org/Npo/Dashboard.aspx"
|
73
|
+
disbursements: "https://account-sandbox.networkforgood.org/Npo/AccountManagement/OrganizationInfo.aspx"
|
74
|
+
staging:
|
75
|
+
auctions:
|
76
|
+
host: "auctions.networkforgood-demo.com"
|
77
|
+
fqdn: "https://api.auctions.networkforgood-demo.com"
|
78
|
+
sso_openid:
|
79
|
+
host: "identity-sandbox.networkforgood.org"
|
80
|
+
fqdn: "https://identity-sandbox.networkforgood.org"
|
81
|
+
discovery_endpoint: "https://identity-sandbox.networkforgood.org"
|
82
|
+
portal:
|
83
|
+
host: "account.networkforgood-demo.com"
|
84
|
+
fqdn: "https://account.networkforgood-demo.com"
|
85
|
+
identity_users:
|
86
|
+
host: "users-sandbox.networkforgood.org"
|
87
|
+
fqdn: "https://users-sandbox.networkforgood.org"
|
88
|
+
dms:
|
89
|
+
host: "dm.networkforgood-demo.com"
|
90
|
+
fqdn: "https://sso.dm.networkforgood-demo.com"
|
91
|
+
evo:
|
92
|
+
host: "networkforgood-demo.com"
|
93
|
+
fqdn: "https://api.networkforgood-demo.com"
|
94
|
+
gp:
|
95
|
+
host: "users-sandbox.networkforgood.org"
|
96
|
+
users_api: "https://users-sandbox.networkforgood.org"
|
97
|
+
dashboard: "https://account-sandbox.networkforgood.org/Npo/Dashboard.aspx"
|
98
|
+
disbursements: "https://account-sandbox.networkforgood.org/Npo/AccountManagement/OrganizationInfo.aspx"
|
99
|
+
qa:
|
100
|
+
auctions:
|
101
|
+
host: "auctions.networkforgood-qa.com"
|
102
|
+
fqdn: "https://api.auctions.networkforgood-qa.com"
|
103
|
+
sso_openid:
|
104
|
+
host: "identity-sandbox.networkforgood.org"
|
105
|
+
fqdn: "https://identity-sandbox.networkforgood.org"
|
106
|
+
discovery_endpoint: "https://identity-sandbox.networkforgood.org"
|
107
|
+
portal:
|
108
|
+
host: "account.networkforgood-qa.com"
|
109
|
+
fqdn: "https://account.networkforgood-qa.com"
|
110
|
+
identity_users:
|
111
|
+
host: "users-sandbox.networkforgood.org"
|
112
|
+
fqdn: "https://users-sandbox.networkforgood.org"
|
113
|
+
dms:
|
114
|
+
host: "dm.networkforgood-qa.com"
|
115
|
+
fqdn: "https://sso.dm.networkforgood-qa.com"
|
116
|
+
evo:
|
117
|
+
host: "networkforgood-qa.com"
|
118
|
+
fqdn: "https://api.networkforgood-qa.com"
|
119
|
+
gp:
|
120
|
+
host: "users-sandbox.networkforgood.org"
|
121
|
+
users_api: "https://users-sandbox.networkforgood.org"
|
122
|
+
dashboard: "https://account-sandbox.networkforgood.org/Npo/Dashboard.aspx"
|
123
|
+
disbursements: "https://account-sandbox.networkforgood.org/Npo/AccountManagement/OrganizationInfo.aspx"
|
124
|
+
production:
|
125
|
+
auctions:
|
126
|
+
host: "auctions.networkforgood.com"
|
127
|
+
fqdn: "https://api.auctions.networkforgood.com"
|
128
|
+
sso_openid:
|
129
|
+
host: "identity.networkforgood.org"
|
130
|
+
fqdn: "https://identity.networkforgood.org"
|
131
|
+
discovery_endpoint: "https://identity.networkforgood.org"
|
132
|
+
portal:
|
133
|
+
host: "account.networkforgood.com"
|
134
|
+
fqdn: "https://account.networkforgood.com"
|
135
|
+
identity_users:
|
136
|
+
host: "users.networkforgood.org"
|
137
|
+
fqdn: "https://users.networkforgood.org"
|
138
|
+
dms:
|
139
|
+
host: "dm.networkforgood.com"
|
140
|
+
fqdn: "https://sso.dm.networkforgood.com"
|
141
|
+
evo:
|
142
|
+
host: "networkforgood.com"
|
143
|
+
fqdn: "https://api.networkforgood.com"
|
144
|
+
gp:
|
145
|
+
host: "users.networkforgood.org"
|
146
|
+
users_api: "https://users.networkforgood.org"
|
147
|
+
dashboard: "https://account.networkforgood.org/Npo/Dashboard.aspx"
|
148
|
+
disbursements: "https://account.networkforgood.org/Npo/AccountManagement/OrganizationInfo.aspx"
|
data/lib/sso_openid.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require "sso_openid/engine"
|
2
|
+
require "sso_openid/middleware"
|
3
|
+
require "sso_openid/paths"
|
4
|
+
require "sso_openid/urls"
|
5
|
+
require "omniauth/openid_connect"
|
6
|
+
|
7
|
+
module SsoOpenid
|
8
|
+
autoload :SpecHelpers, 'sso_openid/spec_helpers'
|
9
|
+
|
10
|
+
class << self
|
11
|
+
attr_accessor :configuration
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.configure
|
15
|
+
self.configuration ||= Configuration.new
|
16
|
+
yield(configuration)
|
17
|
+
end
|
18
|
+
|
19
|
+
class Configuration
|
20
|
+
attr_accessor :identifier, :secret
|
21
|
+
|
22
|
+
def initialize
|
23
|
+
@identifier = nil
|
24
|
+
@secret = nil
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.openid_options
|
28
|
+
{
|
29
|
+
client_options: {
|
30
|
+
port: 443,
|
31
|
+
scheme: "https",
|
32
|
+
host: SsoOpenid::Urls.sso_openid.host,
|
33
|
+
identifier: SsoOpenid.configuration&.identifier,
|
34
|
+
secret: SsoOpenid.configuration&.secret,
|
35
|
+
},
|
36
|
+
callback_path: SsoOpenid::Paths.callback_path,
|
37
|
+
request_path: SsoOpenid::Paths.auth_path,
|
38
|
+
setup_path: SsoOpenid::Paths.setup_path,
|
39
|
+
name: :sso_openid,
|
40
|
+
discovery: true,
|
41
|
+
issuer: SsoOpenid::Urls.sso_openid.discovery_endpoint,
|
42
|
+
setup: true,
|
43
|
+
scope: [:openid, :email, :profile, :address],
|
44
|
+
}
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
metadata
ADDED
@@ -0,0 +1,281 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sso_openid
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 7.2.4.auth0.uat.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Timothy King
|
8
|
+
bindir: bin
|
9
|
+
cert_chain: []
|
10
|
+
date: 2025-10-16 00:00:00.000000000 Z
|
11
|
+
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: rails
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - "~>"
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '7.2'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - "~>"
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '7.2'
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: omniauth
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.9.1
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 1.9.1
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: omniauth_openid_connect
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.3.0
|
47
|
+
type: :runtime
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.3.0
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: json-jwt
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
type: :runtime
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: nokogiri
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 1.13.10
|
75
|
+
type: :runtime
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 1.13.10
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: logger
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
type: :runtime
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: bigdecimal
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
type: :runtime
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: drb
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
type: :runtime
|
118
|
+
prerelease: false
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
name: sqlite3
|
126
|
+
requirement: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '1.6'
|
131
|
+
type: :development
|
132
|
+
prerelease: false
|
133
|
+
version_requirements: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '1.6'
|
138
|
+
- !ruby/object:Gem::Dependency
|
139
|
+
name: rspec-rails
|
140
|
+
requirement: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '6.1'
|
145
|
+
type: :development
|
146
|
+
prerelease: false
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '6.1'
|
152
|
+
- !ruby/object:Gem::Dependency
|
153
|
+
name: rspec_junit_formatter
|
154
|
+
requirement: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
type: :development
|
160
|
+
prerelease: false
|
161
|
+
version_requirements: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
- !ruby/object:Gem::Dependency
|
167
|
+
name: database_cleaner
|
168
|
+
requirement: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
173
|
+
type: :development
|
174
|
+
prerelease: false
|
175
|
+
version_requirements: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0'
|
180
|
+
- !ruby/object:Gem::Dependency
|
181
|
+
name: capybara
|
182
|
+
requirement: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - ">="
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '0'
|
187
|
+
type: :development
|
188
|
+
prerelease: false
|
189
|
+
version_requirements: !ruby/object:Gem::Requirement
|
190
|
+
requirements:
|
191
|
+
- - ">="
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
version: '0'
|
194
|
+
- !ruby/object:Gem::Dependency
|
195
|
+
name: pry
|
196
|
+
requirement: !ruby/object:Gem::Requirement
|
197
|
+
requirements:
|
198
|
+
- - ">="
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
version: '0'
|
201
|
+
type: :development
|
202
|
+
prerelease: false
|
203
|
+
version_requirements: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - ">="
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: '0'
|
208
|
+
- !ruby/object:Gem::Dependency
|
209
|
+
name: pry-byebug
|
210
|
+
requirement: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '0'
|
215
|
+
type: :development
|
216
|
+
prerelease: false
|
217
|
+
version_requirements: !ruby/object:Gem::Requirement
|
218
|
+
requirements:
|
219
|
+
- - ">="
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '0'
|
222
|
+
- !ruby/object:Gem::Dependency
|
223
|
+
name: webmock
|
224
|
+
requirement: !ruby/object:Gem::Requirement
|
225
|
+
requirements:
|
226
|
+
- - ">="
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
version: '0'
|
229
|
+
type: :development
|
230
|
+
prerelease: false
|
231
|
+
version_requirements: !ruby/object:Gem::Requirement
|
232
|
+
requirements:
|
233
|
+
- - ">="
|
234
|
+
- !ruby/object:Gem::Version
|
235
|
+
version: '0'
|
236
|
+
email:
|
237
|
+
- timothy.king@networkforgood.com
|
238
|
+
executables: []
|
239
|
+
extensions: []
|
240
|
+
extra_rdoc_files: []
|
241
|
+
files:
|
242
|
+
- MIT-LICENSE
|
243
|
+
- Rakefile
|
244
|
+
- app/assets/javascripts/sso_openid/application.js
|
245
|
+
- app/assets/stylesheets/sso_openid/application.css
|
246
|
+
- app/controllers/sso_openid/sessions_controller.rb
|
247
|
+
- app/helpers/sso_openid/application_helper.rb
|
248
|
+
- app/views/layouts/sso_openid/application.html.erb
|
249
|
+
- config/initializers/omniauth.rb
|
250
|
+
- config/routes.rb
|
251
|
+
- lib/sso_openid.rb
|
252
|
+
- lib/sso_openid/engine.rb
|
253
|
+
- lib/sso_openid/middleware.rb
|
254
|
+
- lib/sso_openid/paths.rb
|
255
|
+
- lib/sso_openid/spec_helpers.rb
|
256
|
+
- lib/sso_openid/urls.rb
|
257
|
+
- lib/sso_openid/urls.yml
|
258
|
+
- lib/sso_openid/version.rb
|
259
|
+
- lib/tasks/sso_openid_tasks.rake
|
260
|
+
homepage: http://github.com/NetworkForGood
|
261
|
+
licenses:
|
262
|
+
- MIT
|
263
|
+
metadata: {}
|
264
|
+
rdoc_options: []
|
265
|
+
require_paths:
|
266
|
+
- lib
|
267
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
268
|
+
requirements:
|
269
|
+
- - ">="
|
270
|
+
- !ruby/object:Gem::Version
|
271
|
+
version: '0'
|
272
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
273
|
+
requirements:
|
274
|
+
- - ">="
|
275
|
+
- !ruby/object:Gem::Version
|
276
|
+
version: '0'
|
277
|
+
requirements: []
|
278
|
+
rubygems_version: 3.6.2
|
279
|
+
specification_version: 4
|
280
|
+
summary: OpenID implimentation for NFG Rails apps
|
281
|
+
test_files: []
|