crossbario / crossbar

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

Web transport + longpolling does not support authentication? #1205

Open markerikson opened 6 years ago

markerikson commented 6 years ago

I'm looking to add dynamic authentication to an app I'm building, which is currently configured to use a web transport and a longpoll endpoint. I'm going through the various auth examples, and trying to figure out where to add the auth options. Digging through the code in checkconfig.py, it looks like the check_transport_auth() function is only called for websocket endpoints, not for longpolling.

Based on that, it looks like it's not currently possible to add authentication to a longpoll setup. Is there something I'm missing here?

oberstet commented 6 years ago

yes, the longpoll fallback isn't yet completely integrated into all the auth method machinery of crossbar.

related issues:

markerikson commented 6 years ago

@oberstet : thanks for the update. (Also, I'd forgotten that I'd commented on 1077 previously).

I did some playing around with Crossbar yesterday, and was able to successfully implement changes to the config file format and longpoll classes so that a type : longpoll entry accepts an auth field. I'd really like to have the functionality be in an actual Crossbar release, but given that there's a couple existing issues and such, my quick-and-somewhat-dirty edits may not be the right approach for a production implementation.

I'd be happy to collaborate on getting this functionality cleaned up and merged in.

oberstet commented 6 years ago

@markerikson ok, cool! so if you got sth working, best to discuss / get feedback would be to make it into a PR;)

markerikson commented 6 years ago

@oberstet : PR filed. The changes are pretty small - just needed to update the config definition and pass the auth settings through a couple levels so the Session can read it.