crossbario / crossbar

Crossbar.io - WAMP application router
https://crossbar.io/
Other
2.05k stars 274 forks source link

wampcra authentication failed due to recent changes #1243

Open oeway opened 6 years ago

oeway commented 6 years ago

Hi, after upgrade to a recent docker image (crossbario/crossbar:pypy3-17.10.1 and crossbario/crossbar:latest), my previous working code crashes because of this line. In the authmethods, I only specified "wampcra". So my login procedure is to first try "cookie" method, if failed, the user will use their id and password, then use "wampcra".

This is the traceback:

2018-01-30T22:24:17+0000 [Router          9] internal error: 
Traceback (most recent call last):
  File "/usr/local/site-packages/autobahn/wamp/websocket.py", line 95, in onMessage
    self._session.onMessage(msg)
  File "/usr/local/site-packages/crossbar/router/session.py", line 415, in onMessage
    d = txaio.as_future(self.onHello, msg.realm, details)
  File "/usr/local/site-packages/txaio/tx.py", line 417, in as_future
    return maybeDeferred(fun, *args, **kwargs)
  File "/usr/local/site-packages/twisted/internet/defer.py", line 150, in maybeDeferred
    result = f(*args, **kw)
--- <exception caught here> ---
  File "/usr/local/site-packages/crossbar/router/session.py", line 621, in onHello
    assert u'cookie' in authmethods
builtins.AssertionError: 

2018-01-30T22:24:17+0000 [Router          9] internal error: 

Which I believe is related to this line: https://github.com/crossbario/crossbar/commit/1dc3616a94c8b2cd7e042064fde445b1dbdda095#diff-6215d3d558ea87501c495c632a2a5ff9R619

Thank you.

meejah commented 6 years ago

I do not know why that assert is there (which is why I added "needs-investigation") but this definitely looks like a bug; should probably just remove the assert for now and track down "why is it there" separately.

jegger commented 6 years ago

I am running into the exact same issue. I hope you will find the time to fix this soon.