class OmniAuth::Strategies::SSO
Public Class Methods
development_environment?()
click to toggle source
# File lib/sso/client/omniauth/strategies/sso.rb, line 19 def self.development_environment? defined?(Rails) && Rails.env.development? end
endpoint()
click to toggle source
# File lib/sso/client/omniauth/strategies/sso.rb, line 7 def self.endpoint if ENV['OMNIAUTH_SSO_ENDPOINT'].to_s != '' ENV['OMNIAUTH_SSO_ENDPOINT'].to_s elsif development_environment? ENV['OMNIAUTH_SSO_ENDPOINT'] || 'http://sso.dev:8080' elsif test_environment? 'https://sso.example.com' else fail 'You must set OMNIAUTH_SSO_ENDPOINT to point to the SSO OAuth server' end end
passports_path()
click to toggle source
# File lib/sso/client/omniauth/strategies/sso.rb, line 27 def self.passports_path if ENV['OMNIAUTH_SSO_PASSPORTS_PATH'].to_s != '' ENV['OMNIAUTH_SSO_PASSPORTS_PATH'].to_s else # We know this namespace is not occupied because /oauth is owned by Doorkeeper '/oauth/sso/v1/passports' end end
test_environment?()
click to toggle source
# File lib/sso/client/omniauth/strategies/sso.rb, line 23 def self.test_environment? defined?(Rails) && Rails.env.test? || ENV['RACK_ENV'] == 'test' end
Public Instance Methods
raw_info()
click to toggle source
# File lib/sso/client/omniauth/strategies/sso.rb, line 51 def raw_info params = { ip: request.ip, agent: request.user_agent } @raw_info ||= access_token.post(self.class.passports_path, params: params).parsed end