Skip to content
Snippets Groups Projects
Verified Commit cb94de31 authored by Andrej Shadura's avatar Andrej Shadura
Browse files

Parse SSO authentication config on startup

parent 561b26ab
Branches
No related tags found
1 merge request!21OBS SSO implementation
fdo-gitlab:
strategy: gitlab
description: Freedesktop.org GitLab
scope: read_user openid profile email
client_id: hexhexhexhex
client_secret: hexhexhexhex
client_options:
site: https://gitlab.freedesktop.org/api/v4
OmniAuth.config.path_prefix = '/user/sso'
path = Rails.root.join("config", "auth.yml")
begin
CONFIG['sso_auth'] = YAML.load_file(path)
rescue Exception
puts "Error while parsing config file #{path}"
CONFIG['sso_auth'] = Hash.new
end
Rails.application.config.middleware.use OmniAuth::Builder do
CONFIG['sso_auth'].each do |name, options|
options[:name] = name
provider (options['strategy'] || name), options
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment