ActiveMQ: Using Django Auth with Stomp

I am working on power monitoring and want to send real-time data only to authorized users. Some users decide to install power sensors in their homes, while others look at these sensors. Each sensor sends samples to a Twisted backend - the goal is for this backend to send data to Javascript running in the browser.

My current data transfer solution is an Orbited server and an instance of MorbidQ (MorbidQ is a Stomp server). Each building in my system ( example here ) has its own channel for updates. A twisted backend transmits data through the MorbidQ channel to anyone who watches, but everyone can watch. My blog has a record about the flow of data from the sensor to the site

For many buildings, I want several users to be able to see live data in this building. I would like to use Django Auth if possible, or some kind of workaround if not.

What is the easiest way to protect these channels for each user? Can I use Django Auth? Should I use RabbitMQ or ActiveMQ instead of MorbidQ? What measures can I take to protect this decision?

For coding, I am most confident in C ++ and Python.

Thanks!

+4
source share
2 answers

If you use restq extensions for morbidq, you can send him an http callback to your application every time a user tries to connect. (See http://www.morbidq.com/trac/wiki/RestQ ). Then your django application can simply return β€œyes” or β€œno” in an attempt to connect (after it performs some authentication procedure).

+1
source

Reviving the old stream: MorbidQ is not intended for AFAIK production. ActiveMQ is a much more robust beast and provides much better ways to handle user authentication. I wrote this one in 2010, which is dedicated to static user authentication - but ActiveMQ allows you to pass a dynamic list of users for authentication, which can come from depending on which application is available. The message I mentioned above has nothing to do with it, but a little transcoding into the ActiveMQ Authentication / Security section of the guide (plus some Java knowledge) can lead to a rather nasty setting for this use. If LDAP is available, even better.

+1
source

All Articles