class OmniAuth::Strategies::SAMLRMUnify

Private Instance Methods

licence() click to toggle source
# File lib/omniauth/strategies/saml-rmunify.rb, line 40
def licence
  licence_str =  @attributes['http://schemas.rm.com/identity/claims/applicence']
  return nil if licence_str.nil? || licence_str.empty?
  licence = Hash[licence_str[1..-2].split('|').map{|kv|
    (k,v) = kv.split(':')
    [k.underscore, v]
  }]
  licence['is_trial'] = licence['is_trial'] == 'True'
  licence['is_connector'] = licence['is_connector'] == 'True'
  licence.merge!(licence_description(licence))
end
licence_description(licence) click to toggle source
# File lib/omniauth/strategies/saml-rmunify.rb, line 52
def licence_description(licence)
  desc = licence['description'].split('/')
  {
    :app_name     => desc[0],
    :package_name => desc[1],
    :school_type  => desc[2],
    :term         => desc[3]
  }
end