I recently started using cloud cluster and I am trying to use the JWT authentication using React Websocket. I used my NestJS backend to create an endpoint to generate the JWKs. I can’t seem to understand how to configure it right. I am unable to connect to the cluster. I would appreciate a guide to achieve this.
You’re welcome, the key factor here is ensuring the correct password along with the proper Access Token. I recommend testing your custom NestJS JWKS Endpoint setup with an MQTT client tool first, such as the HiveMQ MQTT CLI. You can use the sample command provided below.
Is the provided end point generating a valid response in the required format for the cluster?
I tried the sample command provided and it gives me not authorized.
Response: Unable to connect. Reason: 'CONNECT failed as CONNACK contained an Error Code: NOT_AUTHORIZED.
The token has a limited access lifetime, and you can expire all tokens by restarting your NestJS JWKS Endpoint application. It appears that the token that your application is generating is not valid. You can view an example of a valid token using this JWT Debugger tool link.
Thank you @Diego . If you can provide a best practice guide for HiveMQ-JWT integration using any technology, I would highly appreciate it. Any resource that you think is relevant would be appreciated, thank you.
I can provide you with documents that offer further insights into HiveMQ and JWT. Additionally, you can create a free developer account on Auth0 to run tests using their platform. I frequently use it in my labs, it very useful.
@Diego Do I need to use Enterprise security extention to implement JWT based authentication for cloud starter or Can I follow the path that I was following before?