Sha256: 74b74e25c3377415f2271195e96f49cb140ffd4d814d13e78d1f395445b46db6

Contents?: true

Size: 905 Bytes

Versions: 4

Compression:

Stored size: 905 Bytes

Contents

module Rack
  class Saml
    require 'rack/saml/misc/onelogin_setting'

    class OneloginResponse < AbstractResponse
      include OneloginSetting
      #extend Forwardable

      def initialize(request, config, metadata)
        super(request, config, metadata)
        @response = OneLogin::RubySaml::Response.new(@request.params['SAMLResponse'], {
          :allowed_clock_drift => config['allowed_clock_drift'],
          :settings => saml_settings
        })
      end

      def is_valid?
        begin
          if config['validation_error']
            @response.validate!
          else
            @response.is_valid?
          end
        rescue OneLogin::RubySaml::ValidationError => e
          raise ValidationError.new(e.message)
        end
      end

      def attributes
        @response.attributes
      end

      #def_delegator :@response, :is_valid?, :attributes
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rack-saml-0.2.4 lib/rack/saml/response/onelogin_response.rb
rack-saml-0.2.3 lib/rack/saml/response/onelogin_response.rb
rack-saml-0.2.2 lib/rack/saml/response/onelogin_response.rb
rack-saml-0.2.1 lib/rack/saml/response/onelogin_response.rb