           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
+            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
+            when saml_response.getElementsByTagNameNS(XMLNS.SAMLP, 'LogoutResponse').length is 1
               response.type = 'logout_response'
               setImmediate cb_wf, null, {}
         (result, cb_wf) ->

create_metadata = (issuer, assert_endpoint, signing_certificate, encryption_certificate) ->
  xmlbuilder.create
    'md:EntityDescriptor':
      '@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()
