vidyak
vidyak

Reputation: 173

Client Authentication with node js mosca broker

We are using node.js' Mosca broker module for one of our applications. We are planning to add client authentication with a certificate on the broker side but I'm unable to find any configuration or settings in Mosca has for client authentication.

In the Mosquito broker configuration, the file has one property and requires that the certificate be true. Is there anything similar to that in Mosca?

Upvotes: 3

Views: 2232

Answers (1)

Jack Guy
Jack Guy

Reputation: 8523

According to the documentation, one can authenticate a client using

server.authenticate = function (client, username, password, callback) {
   // To authenticate
   callback(null, true);
   // To reject
   callback(null, false);
}

You can also override this function to be able to use certificate-based authentication or whatever else you wish.

Upvotes: 4

Related Questions