Class: Docusign::AuthHeaderHandler

Inherits:
SOAP::Header::SimpleHandler
  • Object
show all
Defined in:
lib/docusign/auth_header_handler.rb

Constant Summary collapse

NAMESPACE =
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ AuthHeaderHandler

Returns a new instance of AuthHeaderHandler.



24
25
26
27
28
# File 'lib/docusign/auth_header_handler.rb', line 24

def initialize(options={})
  self.attributes = options
  
  super(XSD::QName.new(NAMESPACE, 'Security'))
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



22
23
24
# File 'lib/docusign/auth_header_handler.rb', line 22

def attributes
  @attributes
end

Instance Method Details

#on_simple_outboundObject



30
31
32
33
34
# File 'lib/docusign/auth_header_handler.rb', line 30

def on_simple_outbound
  if attributes[:user_name] && attributes[:password]
    {"UsernameToken" => {"Username" => attributes[:user_name], "Password" => attributes[:password]}}
  end
end