# Use JWT token based authentication with HiveMQ Edge

**URL:** <https://community.hivemq.com/t/use-jwt-token-based-authentication-with-hivemq-edge/3584>\
**Category:** Uncategorized\
**Created:** [February 13, 2025, 6:48am UTC](https://community.hivemq.com/t/use-jwt-token-based-authentication-with-hivemq-edge/3584 "2025-02-13T06:48:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Payal](https://avatars.discourse-cdn.com/v4/letter/p/9de053/32.png) [@Payal](https://community.hivemq.com/u/Payal)\
**Post date:** [February 13, 2025, 6:48am UTC](https://community.hivemq.com/t/use-jwt-token-based-authentication-with-hivemq-edge/3584/1 "2025-02-13T06:48:48Z")

</div>

Hi,  
I am using HiveMQ-Edge Broker.

I have a react-js front end app, currently I am using self-signed certificate to enable secured websocket connection to connect to hivemq edge broker.  
I want to use JWT token to connect with hivemq-edge broker. Could you please guide me to correct configurations?

another question I have is- how to add username and password to the config.xml file of hivemq-edge to enable basic authentication. so that whenever react.js app tries to connect with the broker it should provide username and password.

---

<div class="post-metadata">

**Author:** ![Daria\_H](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Daria\_H](https://community.hivemq.com/u/Daria_H)\
**Post date:** [February 13, 2025, 9:29am UTC](https://community.hivemq.com/t/use-jwt-token-based-authentication-with-hivemq-edge/3584/2 "2025-02-13T09:29:05Z")

</div>

Hi @Payal

Thank you for reaching out!

HiveMQ Edge does not support JWT-based authentication at this time.

If you need more details or have any other questions, feel free to ask!

Best regards,  
Dasha from The HiveMQ Team

---

<div class="post-metadata">

**Author:** ![Payal](https://avatars.discourse-cdn.com/v4/letter/p/9de053/32.png) [@Payal](https://community.hivemq.com/u/Payal)\
**Post date:** [February 13, 2025, 10:35am UTC](https://community.hivemq.com/t/use-jwt-token-based-authentication-with-hivemq-edge/3584/3 "2025-02-13T10:35:58Z")

</div>

> [@Payal](#):
>
> how to add username and password to the config.xml file of hivemq-edge to enable basic authentication.

Do you have any react.js support for certificate authentication? we are trying it but we cannot add certificate in react.js code it seems.

---

<div class="post-metadata">

**Author:** ![Daria\_H](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Daria\_H](https://community.hivemq.com/u/Daria_H)\
**Post date:** [February 13, 2025, 4:35pm UTC](https://community.hivemq.com/t/use-jwt-token-based-authentication-with-hivemq-edge/3584/4 "2025-02-13T16:35:58Z")

</div>

Hi @Payal,

HiveMQ does not provide an official MQTT client for React.js. However, we do offer the following client libraries:

- [HiveMQ MQTT Client for Java](https://github.com/hivemq/hivemq-mqtt-client)
- [HiveMQ MQTT Client for .NET](https://github.com/hivemq/hivemq-mqtt-client-dotnet)

For React.js, you may consider using a third-party MQTT JavaScript client. You can find an example in your HiveMQ Cloud Console [https://console.hivemq.cloud](https://console.hivemq.cloud) in the Getting Started top-bar right menu:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/hivemq1/original/2X/6/668114cab325884c71c167f4ddea6fa4aed3d242.jpeg)

I hope this helps! Let me know if you have any further questions.

Best regards,  
Dasha  
HiveMQ Support Team

---

<div class="post-metadata">

**Author:** ![Payal](https://avatars.discourse-cdn.com/v4/letter/p/9de053/32.png) [@Payal](https://community.hivemq.com/u/Payal)\
**Post date:** [February 14, 2025, 5:54am UTC](https://community.hivemq.com/t/use-jwt-token-based-authentication-with-hivemq-edge/3584/5 "2025-02-14T05:54:57Z")

</div>

> [@Daria\_H](#):
>
> Q Cloud Cons

okay I will check this out. meanwhile can you tell me how to add username and password in the hivemq broker config.xml?

currently we are setting RBAC extension to allow and creating new file with following credentials:

\<?xml version="1.0" encoding="UTF-8" standalone="yes"?\> admin

pass1  
  
admin  
  
  
  
  
  
admin

#

Is there any basic authentication for hivemq broker? username and password?

---

<div class="post-metadata">

**Author:** ![Daria\_H](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Daria\_H](https://community.hivemq.com/u/Daria_H)\
**Post date:** [February 19, 2025, 10:37am UTC](https://community.hivemq.com/t/use-jwt-token-based-authentication-with-hivemq-edge/3584/6 "2025-02-19T10:37:04Z")

</div>

Hi @Payal

To enable Role-Based Access Control (RBAC) in **HiveMQ Edge** , you need to install a _security_ extension. HiveMQ provides an open-source security extension called the **File RBAC Extension** , which you can find here: [File RBAC Extension Documentation](https://github.com/hivemq/hivemq-file-rbac-extension).

Below are the steps to install the extension:

```bash
wget https://github.com/hivemq/hivemq-file-rbac-extension/releases/download/4.6.3/hivemq-file-rbac-extension-4.6.3.zip

unzip hivemq-file-rbac-extension-4.6.3.zip -d $HIVEMQ_HOME/extensions

touch $HIVEMQ_HOME/extensions/hivemq-allow-all-extension/DISABLED

```

This will install the File RBAC Extension and disable the “Allow All” extension to ensure that RBAC rules are enforced in **HiveMQ Edge**.

Check your working using MQTT-CLI client. ([Documentation and Installation Instructions here](https://hivemq.github.io/mqtt-cli/)). In one terminal window, subscribe the client:

```bash
mqtt subscribe --topic '#' --qos 1 --identifier SUBSCRIBER --user admin-user --password admin-password --debug --verbose

```

In another terminal window, publish a message from the client:

```bash
mqtt publish --topic 'test' --qos 1 --identifier PUBLISHER --user admin-user --password admin-password --debug --verbose

```

Please let me know if you need any further assistance!

Best regards,  
Dasha from The HiveMQ Team

---

<div class="post-metadata">

**Author:** ![Payal](https://avatars.discourse-cdn.com/v4/letter/p/9de053/32.png) [@Payal](https://community.hivemq.com/u/Payal)\
**Post date:** [March 3, 2025, 4:47am UTC](https://community.hivemq.com/t/use-jwt-token-based-authentication-with-hivemq-edge/3584/7 "2025-03-03T04:47:43Z")

</div>

Hi @Daria_H, Apologies for late response, I was under impression that RBAC is for setting username and password for UI which is running on port 8080.  
but this cleared the misunderstanding.  
I will try to set the username and password using given steps and check If I can access the broker.
