How to force WAMP Ticket Authentication?

117 Views Asked by At

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!

0

There are 0 best solutions below