       saml_response = (new xmldom.DOMParser()).parseFromString(new Buffer(request_body.SAMLResponse, 'base64').toString())
       decrypted_assertion = null
 
+      user = {}
+
       async.waterfall [
         (cb_wf) -> check_status_success saml_response, cb_wf
         (cb_wf) => decrypt_assertion saml_response, @private_key, cb_wf

  signature = xmlcrypto.xpath(doc, "/*/*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']")[0]
  sig = new xmlcrypto.SignedXml()
  sig.keyInfoProvider = getKey: -> certificate
  sig.loadSignature(signature.toString())
  return cb null if sig.checkSignature(xml)
  cb new Error("SAML Assertion signature check failed!")



    # -- Required
    # Returns a redirect URL, at which a user can login
    create_login_url: (identity_provider, assert_endpoint, cb) =>
      zlib.deflateRaw create_authn_request(@issuer, assert_endpoint, identity_provider.sso_login_url), (err, deflated) ->
        cb err if err?
        cb null, "#{identity_provider.sso_login_url}?SAMLRequest=" + encodeURIComponent(deflated.toString('base64'))

