Sha256: 81bf3c8ff3dc31afa72d1b16250eeffeed4a618a3be6241020f53cb2bd70291c
Contents?: true
Size: 1.12 KB
Versions: 2
Compression:
Stored size: 1.12 KB
Contents
# frozen_string_literal: true require "nulogy_sso/engine" module NulogySSO # Config variables for the engine mattr_accessor :sso_config, :find_user_by_email, :handle_sso_error mattr_accessor :handle_unauthenticated_request, default: lambda { |controller| controller.redirect_to NulogySSO::Engine.routes.url_helpers.login_path } # Public Constants JWT_EMAIL_KEY = "https://nulogy.net/email" def self.sso_config=(sso_config_hash) raise "sso_config must be a Hash" unless sso_config_hash.is_a? Hash missing_keys = REQUIRED_SSO_CONFIG_KEYS - sso_config_hash.symbolize_keys.keys if missing_keys.present? raise "Missing required sso_config keys ['#{missing_keys.join("', '")}']" end @@sso_config = SSOConfig.new(**sso_config_hash.symbolize_keys) end REQUIRED_SSO_CONFIG_KEYS = %i[ audience base_uri client_id client_secret cookie_prefix login_uri redirect_uri ] private_constant :REQUIRED_SSO_CONFIG_KEYS SSOConfig = Struct.new(*REQUIRED_SSO_CONFIG_KEYS, keyword_init: true) def self.sso_cookie_key "#{sso_config.cookie_prefix}_access_token" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
nulogy_sso-2.1.0 | lib/nulogy_sso.rb |
nulogy_sso-2.0.0 | lib/nulogy_sso.rb |