Package io.moquette.broker.security
Class DBAuthenticator
- java.lang.Object
-
- io.moquette.broker.security.DBAuthenticator
-
- All Implemented Interfaces:
IAuthenticator
public class DBAuthenticator extends Object implements IAuthenticator
Load user credentials from a SQL database. sql driver must be provided at runtime
-
-
Constructor Summary
Constructors Constructor Description DBAuthenticator(IConfig conf)DBAuthenticator(String driver, String jdbcUrl, String sqlQuery, String digestMethod)provide authenticator from SQL database
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckValid(String clientId, String username, byte[] password)
-
-
-
Constructor Detail
-
DBAuthenticator
public DBAuthenticator(IConfig conf)
-
DBAuthenticator
public DBAuthenticator(String driver, String jdbcUrl, String sqlQuery, String digestMethod)
provide authenticator from SQL database- Parameters:
driver- : jdbc driver class like : "org.postgresql.Driver"jdbcUrl- : jdbc url like : "jdbc:postgresql://host:port/dbname"sqlQuery- : sql query like : "SELECT PASSWORD FROM USER WHERE LOGIN=?"digestMethod- : password encoding algorithm : "MD5", "SHA-1", "SHA-256"
-
-
Method Detail
-
checkValid
public boolean checkValid(String clientId, String username, byte[] password)
- Specified by:
checkValidin interfaceIAuthenticator
-
-