Sign inSign up

flowfuse/emqx-ff-jwt-auth

By flowfuse

Updated 22 days ago

Image
0

667

flowfuse/emqx-ff-jwt-auth repository overview

Authentication code for FF Expert central broker

This code allows EMQX to authenticate connections using FF EE Licenses as JWTs

index.js

This is a EMQX HTTP Authentication and Authorization backend API that validates FF JWT licenses as MQTT passwords (uses license id as username)

This is used to validate the bridge connections and namespaces each connection with a <license.id>/ prefix

Running Locally

Install dependencies
npm install
Linux/MacOS
export AGENT_USER=ff-expert-agent
export AGENT_PASS=ff-expert-agent-pass
export AGENT_DEBUG_USER=ff-expert-agent-debug
export AGENT_DEBUG_PASS=ff-expert-agent-debug-pass
export MCP_GATEWAY_USER=ff-mcp-gateway
export MCP_GATEWAY_PASS=ff-mcp-gateway-pass
export MCP_GATEWAY_DEBUG_USER=ff-mcp-gateway-debug
export MCP_GATEWAY_DEBUG_PASS=ff-mcp-gateway-debug-pass
export DEBUG=true # optional, enables debug logging
node index.js
Windows (CMD terminal)
set AGENT_USER=ff-expert-agent
set AGENT_PASS=ff-expert-agent-pass
set AGENT_DEBUG_USER=ff-expert-agent-debug
set AGENT_DEBUG_PASS=ff-expert-agent-debug-pass
set MCP_GATEWAY_USER=ff-mcp-gateway
set MCP_GATEWAY_PASS=ff-mcp-gateway-pass
set MCP_GATEWAY_DEBUG_USER=ff-mcp-gateway-debug
set MCP_GATEWAY_DEBUG_PASS=ff-mcp-gateway-debug-pass
set DEBUG=true # optional, enables debug logging
node index.js

Example bridge setup code

create-bridge directory

This is a short bit of code to configure a bridge on a EMQX instance It does inbound and outbound topic mapping which will need to be adjusted actual behaviour of the FF Expert

Template objects sent to the EMQX API are in the templates.js file

Tag summary

Content type

Image

Digest

sha256:36e246c9a

Size

57.5 MB

Last updated

22 days ago

docker pull flowfuse/emqx-ff-jwt-auth