lib/maestrano/saml/response.rb in maestrano-0.11.0 vs lib/maestrano/saml/response.rb in maestrano-0.12.0
- old
+ new
@@ -2,12 +2,13 @@
require "nokogiri"
# Only supports SAML 2.0
module Maestrano
module Saml
-
class Response
+ include Preset
+
ASSERTION = "urn:oasis:names:tc:SAML:2.0:assertion"
PROTOCOL = "urn:oasis:names:tc:SAML:2.0:protocol"
DSIG = "http://www.w3.org/2000/09/xmldsig#"
# TODO: This should probably be ctor initialized too... WDYT?
@@ -20,10 +21,10 @@
def initialize(response, options = {})
raise ArgumentError.new("Response cannot be nil") if response.nil?
@options = options
@response = (response =~ /^</) ? response : Base64.decode64(response)
@document = Maestrano::XMLSecurity::SignedDocument.new(@response)
- @settings = Maestrano::SSO.saml_settings
+ @settings = Maestrano::SSO[self.class.preset].saml_settings
end
def is_valid?
validate
end