mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
23 lines
625 B
Ruby
23 lines
625 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'omniauth_openid_connect'
|
|
|
|
module OmniAuth::Strategies
|
|
# Authentication strategy provided trough OpenID Connect
|
|
class SsoOpenidConnectProvider < OmniAuth::Strategies::OpenIDConnect
|
|
|
|
def self.active_provider
|
|
active_provider = AuthProvider.active
|
|
if active_provider.providable_type != OpenIdConnectProvider.name
|
|
raise "Trying to instantiate the wrong provider: Expected OpenIdConnectProvider, received #{active_provider.providable_type}"
|
|
end
|
|
|
|
active_provider
|
|
end
|
|
|
|
# Strategy name.
|
|
option :name, active_provider.strategy_name
|
|
|
|
end
|
|
end
|