Better HN
topnewbestaskshowjobs
Log inSign up

fuhry

7 karma · joined Jun 1, 2018 (8y ago) · 2 submissions

SRE @ Dropbox / Husband / Christian / Gearhead / General nerd.

[ my public key: https://keybase.io/fuhry; my proof: https://keybase.io/fuhry/sigs/LSV-cjK1ZRBHzNwe7KSZ5MdRydj0lzdGmVsGENQVY-w ]

Submissions

comment 5y ago · link · parent

My approach with a recent personal project (i.e. no actual scaling required) was to have the MQTT server just listen on localhost. Application connects without TLS on the loopback interface. Clients connect over WebSocket (TLS) using their existing OAuth access token as the username and "x" as the password. The application involves an API as well so client credentials are already in use.

I used jpmens/mosquitto-auth-plug <https://github.com/jpmens/mosquitto-auth-plug> for the Mosquitto side of things, with a query along the lines of:

  SELECT "hardcoded password hash" FROM oauth_access_tokens WHERE access_token = "%s" AND scope REGEXP "\bmqtt\b";

comment 5y ago · link · parent

Wife and I are hopefully less than 2 months away from being licensed. If we can do it in our tiny 2 bedroom house, you can too!