thepug / Mod-Http-Pre-Bind

An ejabberd module that pre binds an anonymous sasl session, returning the authenticated session.
http://code.stanziq.com
Other
47 stars 17 forks source link

Empty responses #4

Open cdecker opened 12 years ago

cdecker commented 12 years ago

I installed the pre-bind module as instruvted. The GET handler works as expected, but when I try the to get a new session with

curl -d "<body to='jabber.my.tld' rid='1234567' wait='60' hold='1' />" http://localhost:5280/http-pre-bind/

I only get empty responses.

The log file does not help either:


=INFO REPORT==== 2012-06-24 23:00:11 ===
I(<0.365.0>:ejabberd_listener:232) : (#Port<0.3011>) Accepted connection {{192,168,2,10},48274} -> {{192,168,2,10},5280}

=INFO REPORT==== 2012-06-24 23:00:11 ===
I(<0.395.0>:ejabberd_http:138) : started: {gen_tcp,#Port<0.3011>}

=INFO REPORT==== 2012-06-24 23:00:42 ===
I(<0.396.0>:ejabberd_http_bind:508) : Session timeout. Closing the HTTP bind session: "d408f8688f03d57f9870481b423ff9bc2b7d298f"
m4tm4t commented 11 years ago

I'm getting the same behavior with the prebind.js example

have you finally found something?

m4tm4t commented 11 years ago

@thepug The pre-bin request raise a Error on HTTP put. Reason: bad_key

https://gist.github.com/f60fb0423454ee93557c (the log cover only one /pre-bind request)

here my request:

  self.init = (options) ->
    self.debug = options.debug
    Presence.Utils.log "Initializing XMPP client"

    prebind_data = $build("body",
        to: domain
        rid: (''+Math.floor(Math.random() * 4294967295))
        wait: "60"
        hold: "1"
    ).toString()

    $.ajax
      type: "POST"
      url: prebind_service
      contentType: "text/xml"
      processData: false
      dataType: "xml"
      data: prebind_data
      error: (data) ->
        console.log data
        self.connect($("li.login").data("user-slug")+"@"+domain, "AuthenticationByCookie>>"+cookie)
      success: (data) ->
        self.attach(data)

    $(window).unload ->
      console.log "[WINDOW] unload -> disconnect()"
      Presence.Core.disconnect()
      return
    return
thepug commented 11 years ago

It looks like anonymous logins are turned off. I don't see it in the list of auth features available.