 create_metadata = (issuer, assert_endpoint, signing_certificate, encryption_certificate) ->
   xmlbuilder.create
     'md:EntityDescriptor':
-      '@xmlns:md': xmlns.md
-      '@xmlns:ds': xmlns.ds
+      '@xmlns:md': XMLNS.MD
+      '@xmlns:ds': XMLNS.DS
       '@entityID': issuer
       'md:SPSSODescriptor': [
           '@protocolSupportEnumeration': 'urn:oasis:names:tc:SAML:1.1:protocol urn:oasis:names:tc:SAML:2.0:protocol',

  id = '_' + crypto.randomBytes(21).toString('hex')
  xml = xmlbuilder.create
    AuthnRequest:
      '@xmlns': xmlns.samlp
      '@xmlns:saml': xmlns.saml
      '@Version': '2.0'
      '@ID': id
      '@IssueInstant': (new Date()).toISOString()

          response = { response_header }
          cb_wf new Error("SAML Response was not success!") unless check_status_success(saml_response)
          switch
            when saml_response.getElementsByTagNameNS(XMLNS.SAMLP, 'Response').length is 1
              response.type = 'authn_response'
              parse_authn_response saml_response, @private_key, identity_provider.certificate, cb_wf
            when saml_response.getElementsByTagNameNS(XMLNS.SAMLP, 'LogoutResponse').length is 1
              response.type = 'logout_response'
              setImmediate cb_wf, null, {}
        (result, cb_wf) ->
