0

I'm using the older Autobahn|Python subclassing API so that I can include ticket authentication for connecting to a WAMP bus. When I run all parts of the environment on my local machine, everything works fine and dandy - connection, challenge, authentication, publication of messages - but when I move over to my testing environment on an external server, the challenge for authentication doesn't seem to happen. My subclass looks like this:

class ClientSession(ApplicationSession):
    def onConnect(self):
        log("Session connected")
        self.join(self.config.realm, [u"ticket"], ROLE_ID)
    def onChallenge(self, challenge):
        log("Authentication challenged")
        if challenge.method == u"ticket":
            return TICKET
    @inlineCallbacks
    def onJoin(session, details):
        log("Connected to WAMP")
        while True:
            session.publish(u"topic", message)
            yield(60)
if __name__ == "__main__":
    RUNNER = ApplicationSession(url=WAMP_URL, realm=u"my-realm")
    RUNNER.run(ClientSession)

When I run the full application on my computer, it goes through all of the steps perfectly fine, but when I run it on my test server that has a slightly different configuration, the only output that is logged is from the onConnect method. I need the authentication to be able to publish messages. Help!

Emily
  • 119
  • 1
  • 3
  • 13
  • The guess with the fewest assumptions would be that something that differs between your computer and your external server makes a difference. A related guess would be that the network differences between the two configurations makes a difference. But it's pretty challenging to narrow it down further from there. There are too many ways a computer or a network could be different from another. I think solving your problem will hinge on reducing the differences between these configurations until they are similar enough that you can spot the remaining _important_ difference. – Jean-Paul Calderone May 22 '18 at 20:33
  • @Jean-PaulCalderone Thanks for the recommendation. I ran my local configuration on the dev server and discovered that I hadn't been updating the crossbar config file in the right path on the dev server, so it didn't have the correct principals. I guess it was just silently failing the challenge. I feel pretty dumb. – Emily May 23 '18 at 14:49
  • Glad you found the problem. No reason to feel dumb. There's really no such thing as a "simple explanation". There's just an incredibly vast ocean of minutia, every last corner of which must have the right state for things to go right... It's pretty common for a corner or two to get overlooked for a while from time to time. – Jean-Paul Calderone May 23 '18 at 15:50

0 Answers0