public interface MongoAuth extends AuthProvider
MongoClient as store| Modifier and Type | Field and Description | 
|---|---|
static String | 
DEFAULT_COLLECTION_NAME
The default name of the collection to be used 
 | 
static String | 
DEFAULT_CREDENTIAL_PASSWORD_FIELD
The default name of the property for the password, like it is transported in credentials by method
  
AuthProvider.authenticate(JsonObject, Handler) | 
static String | 
DEFAULT_CREDENTIAL_USERNAME_FIELD
The default name of the property for the username, like it is transported in credentials by method
  
AuthProvider.authenticate(JsonObject, Handler) | 
static String | 
DEFAULT_PASSWORD_FIELD
The default name of the property for the password, like it is stored in mongodb 
 | 
static String | 
DEFAULT_PERMISSION_FIELD
The default name of the property for the permissions, like it is stored in mongodb. 
 | 
static String | 
DEFAULT_ROLE_FIELD
The default name of the property for the roles, like it is stored in mongodb. 
 | 
static String | 
DEFAULT_SALT_FIELD
The default name of the property for the salt field 
 | 
static String | 
DEFAULT_USERNAME_FIELD
The default name of the property for the username, like it is stored in mongodb 
 | 
static String | 
PROPERTY_COLLECTION_NAME
The property name to be used to set the name of the collection inside the config 
 | 
static String | 
PROPERTY_CREDENTIAL_PASSWORD_FIELD
The property name to be used to set the name of the field, where the password for the credentials is stored inside 
 | 
static String | 
PROPERTY_CREDENTIAL_USERNAME_FIELD
The property name to be used to set the name of the field, where the username for the credentials is stored inside 
 | 
static String | 
PROPERTY_PASSWORD_FIELD
The property name to be used to set the name of the field, where the password is stored inside 
 | 
static String | 
PROPERTY_PERMISSION_FIELD
The property name to be used to set the name of the field, where the permissions are stored inside 
 | 
static String | 
PROPERTY_ROLE_FIELD
The property name to be used to set the name of the field, where the roles are stored inside 
 | 
static String | 
PROPERTY_SALT_FIELD
The property name to be used to set the name of the field, where the SALT is stored inside 
 | 
static String | 
PROPERTY_SALT_STYLE
The property name to be used to set the name of the field, where the salt style is stored inside 
 | 
static String | 
PROPERTY_USERNAME_FIELD
The property name to be used to set the name of the field, where the username is stored inside 
 | 
static String | 
ROLE_PREFIX
The prefix which is used by the method  
User.isAuthorised(String, Handler) when checking for role access | 
| Modifier and Type | Method and Description | 
|---|---|
static MongoAuth | 
create(MongoClient mongoClient,
      JsonObject config)
Creates an instance of MongoAuth by using the given  
MongoClient and configuration object. | 
String | 
getCollectionName()
The name of the collection used to store User objects inside. 
 | 
HashStrategy | 
getHashStrategy()
The HashStrategy which is used by the current instance 
 | 
String | 
getPasswordCredentialField()
Get the name of the field to be used as property for the password of credentials in the method
  
AuthProvider.authenticate(JsonObject, io.vertx.core.Handler). | 
String | 
getPasswordField()
Get the name of the field to be used for the password Defaults to  
DEFAULT_PASSWORD_FIELD | 
String | 
getPermissionField()
Get the name of the field to be used for the permissions. 
 | 
String | 
getRoleField()
Get the name of the field to be used for the roles. 
 | 
String | 
getSaltField()
Get the name of the field to be used for the salt. 
 | 
String | 
getUsernameCredentialField()
Get the name of the field to be used as property for the username in the method
  
AuthProvider.authenticate(JsonObject, io.vertx.core.Handler). | 
String | 
getUsernameField()
Get the name of the field to be used for the username. 
 | 
void | 
insertUser(String username,
          String password,
          List<String> roles,
          List<String> permissions,
          Handler<AsyncResult<String>> resultHandler)
Insert a new user into mongo in the convenient way 
 | 
MongoAuth | 
setCollectionName(String collectionName)
Set the name of the collection to be used. 
 | 
MongoAuth | 
setHashAlgorithm(HashAlgorithm hashAlgorithm)
The Hash Algorithm which is used by the current instance 
 | 
MongoAuth | 
setHashStrategy(HashStrategy hashStrategy)
The HashStrategy which is used by the current instance 
 | 
MongoAuth | 
setPasswordCredentialField(String fieldName)
Set the name of the field to be used as property for the password of credentials in the method
  
AuthProvider.authenticate(JsonObject, io.vertx.core.Handler). | 
MongoAuth | 
setPasswordField(String fieldName)
Set the name of the field to be used for the password Defaults to  
DEFAULT_PASSWORD_FIELD | 
MongoAuth | 
setPermissionField(String fieldName)
Set the name of the field to be used for the permissions. 
 | 
MongoAuth | 
setRoleField(String fieldName)
Set the name of the field to be used for the roles. 
 | 
MongoAuth | 
setSaltField(String fieldName)
Set the name of the field to be used for the salt. 
 | 
MongoAuth | 
setUsernameCredentialField(String fieldName)
Set the name of the field to be used as property for the username in the method
  
AuthProvider.authenticate(JsonObject, io.vertx.core.Handler). | 
MongoAuth | 
setUsernameField(String fieldName)
Set the name of the field to be used for the username. 
 | 
authenticatestatic final String PROPERTY_COLLECTION_NAME
static final String PROPERTY_USERNAME_FIELD
static final String PROPERTY_ROLE_FIELD
static final String PROPERTY_PERMISSION_FIELD
static final String PROPERTY_PASSWORD_FIELD
static final String PROPERTY_CREDENTIAL_USERNAME_FIELD
static final String PROPERTY_CREDENTIAL_PASSWORD_FIELD
static final String PROPERTY_SALT_FIELD
static final String PROPERTY_SALT_STYLE
HashSaltStyle, 
Constant Field Valuesstatic final String DEFAULT_COLLECTION_NAME
static final String DEFAULT_USERNAME_FIELD
static final String DEFAULT_PASSWORD_FIELD
static final String DEFAULT_ROLE_FIELD
static final String DEFAULT_PERMISSION_FIELD
static final String DEFAULT_CREDENTIAL_USERNAME_FIELD
AuthProvider.authenticate(JsonObject, Handler)static final String DEFAULT_CREDENTIAL_PASSWORD_FIELD
AuthProvider.authenticate(JsonObject, Handler)static final String DEFAULT_SALT_FIELD
static final String ROLE_PREFIX
User.isAuthorised(String, Handler) when checking for role accessstatic MongoAuth create(MongoClient mongoClient, JsonObject config)
MongoClient and configuration object. An example for a
 configuration object:
 JsonObject js = new JsonObject(); js.put(MongoAuth.PROPERTY_COLLECTION_NAME, createCollectionName(MongoAuth.DEFAULT_COLLECTION_NAME));
mongoClient - an instance of MongoClient to be used for data storage and retrivalconfig - the configuration object for the current instance. By thisMongoAuthsMongoAuth setCollectionName(String collectionName)
DEFAULT_COLLECTION_NAMEcollectionName - the name of the collection to be used for storing and reading user dataMongoAuth setUsernameField(String fieldName)
DEFAULT_USERNAME_FIELDfieldName - the name of the field to be usedMongoAuth setPasswordField(String fieldName)
DEFAULT_PASSWORD_FIELDfieldName - the name of the field to be usedMongoAuth setRoleField(String fieldName)
DEFAULT_ROLE_FIELD. Roles are expected to
 be saved as JsonArrayfieldName - the name of the field to be usedMongoAuth setPermissionField(String fieldName)
DEFAULT_PERMISSION_FIELD.
 Permissions are expected to be saved as JsonArrayfieldName - the name of the field to be usedMongoAuth setUsernameCredentialField(String fieldName)
AuthProvider.authenticate(JsonObject, io.vertx.core.Handler). Defaults to DEFAULT_CREDENTIAL_USERNAME_FIELDfieldName - the name of the field to be usedMongoAuth setPasswordCredentialField(String fieldName)
AuthProvider.authenticate(JsonObject, io.vertx.core.Handler). Defaults to DEFAULT_CREDENTIAL_PASSWORD_FIELDfieldName - the name of the field to be usedMongoAuth setSaltField(String fieldName)
HashStrategy.setSaltStyle(HashSaltStyle) is
 set to HashSaltStyle.COLUMNfieldName - the name of the field to be usedString getCollectionName()
DEFAULT_COLLECTION_NAMEString getUsernameField()
DEFAULT_USERNAME_FIELDString getPasswordField()
DEFAULT_PASSWORD_FIELDString getRoleField()
DEFAULT_ROLE_FIELD. Roles are expected to
 be saved as JsonArrayString getPermissionField()
DEFAULT_PERMISSION_FIELD.
 Permissions are expected to be saved as JsonArrayString getUsernameCredentialField()
AuthProvider.authenticate(JsonObject, io.vertx.core.Handler). Defaults to DEFAULT_CREDENTIAL_USERNAME_FIELDString getPasswordCredentialField()
AuthProvider.authenticate(JsonObject, io.vertx.core.Handler). Defaults to DEFAULT_CREDENTIAL_PASSWORD_FIELDString getSaltField()
HashStrategy.setSaltStyle(HashSaltStyle) is
 set to HashSaltStyle.COLUMNMongoAuth setHashStrategy(HashStrategy hashStrategy)
hashStrategy - the HashStrategy to be setHashStrategy getHashStrategy()
HashStrategyMongoAuth setHashAlgorithm(HashAlgorithm hashAlgorithm)
hashAlgorithm - the HashAlgorithm to be setvoid insertUser(String username, String password, List<String> roles, List<String> permissions, Handler<AsyncResult<String>> resultHandler)
username - the username to be setpassword - the passsword in clear text, will be adapted following the definitions of the defined HashStrategyroles - a list of roles to be setpermissions - a list of permissions to be setresultHandler - the ResultHandler will be provided with the id of the generated recordCopyright © 2020 Eclipse. All rights reserved.