An extension of AuthProvider which is using as store
Constructor and description |
---|
MongoAuth
(java.lang.Object delegate) |
Type | Name and description |
---|---|
static MongoAuth |
create(MongoClient mongoClient, java.util.Map<java.lang.String, java.lang.Object> config) Creates an instance of MongoAuth by using the given and configuration object. |
java.lang.String |
getCollectionName() The name of the collection used to store User objects inside. |
java.lang.Object |
getDelegate() |
HashStrategy |
getHashStrategy() The HashStrategy which is used by the current instance |
java.lang.String |
getPasswordCredentialField() Get the name of the field to be used as property for the password of credentials in the method AuthProvider.authenticate. |
java.lang.String |
getPasswordField() Get the name of the field to be used for the password Defaults to MongoAuth |
java.lang.String |
getPermissionField() Get the name of the field to be used for the permissions. |
java.lang.String |
getRoleField() Get the name of the field to be used for the roles. |
java.lang.String |
getSaltField() Get the name of the field to be used for the salt. |
java.lang.String |
getUsernameCredentialField() Get the name of the field to be used as property for the username in the method AuthProvider.authenticate. |
java.lang.String |
getUsernameField() Get the name of the field to be used for the username. |
void |
insertUser(java.lang.String username, java.lang.String password, java.util.List<java.lang.String> roles, java.util.List<java.lang.String> permissions, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> resultHandler) Insert a new user into mongo in the convenient way |
MongoAuth |
setCollectionName(java.lang.String collectionName) Set the name of the collection to be used. |
MongoAuth |
setHashStrategy(HashStrategy hashStrategy) The HashStrategy which is used by the current instance |
MongoAuth |
setPasswordCredentialField(java.lang.String fieldName) Set the name of the field to be used as property for the password of credentials in the method AuthProvider.authenticate. |
MongoAuth |
setPasswordField(java.lang.String fieldName) Set the name of the field to be used for the password Defaults to MongoAuth |
MongoAuth |
setPermissionField(java.lang.String fieldName) Set the name of the field to be used for the permissions. |
MongoAuth |
setRoleField(java.lang.String fieldName) Set the name of the field to be used for the roles. |
MongoAuth |
setSaltField(java.lang.String fieldName) Set the name of the field to be used for the salt. |
MongoAuth |
setUsernameCredentialField(java.lang.String fieldName) Set the name of the field to be used as property for the username in the method AuthProvider.authenticate. |
MongoAuth |
setUsernameField(java.lang.String fieldName) Set the name of the field to be used for the username. |
Methods inherited from class | Name |
---|---|
class AuthProvider |
authenticate, getDelegate |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Creates an instance of MongoAuth by using the given 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 to be used for data storage and retrivalconfig
- the configuration object for the current instance. By thisThe name of the collection used to store User objects inside. Defaults to MongoAuth
The HashStrategy which is used by the current instance
Get the name of the field to be used as property for the password of credentials in the method AuthProvider.authenticate. Defaults to MongoAuth
Get the name of the field to be used for the password Defaults to MongoAuth
Get the name of the field to be used for the permissions. Defaults to MongoAuth. Permissions are expected to be saved as JsonArray
Get the name of the field to be used for the roles. Defaults to MongoAuth. Roles are expected to be saved as JsonArray
Get the name of the field to be used for the salt. Only used when HashStrategy.setSaltStyle is set to
Get the name of the field to be used as property for the username in the method AuthProvider.authenticate. Defaults to MongoAuth
Get the name of the field to be used for the username. Defaults to MongoAuth
Insert a new user into mongo in the convenient way
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 recordSet the name of the collection to be used. Defaults to MongoAuth
collectionName
- the name of the collection to be used for storing and reading user dataThe HashStrategy which is used by the current instance
hashStrategy
- the HashStrategy to be setSet the name of the field to be used as property for the password of credentials in the method AuthProvider.authenticate. Defaults to MongoAuth
fieldName
- the name of the field to be usedSet the name of the field to be used for the password Defaults to MongoAuth
fieldName
- the name of the field to be usedSet the name of the field to be used for the permissions. Defaults to MongoAuth. Permissions are expected to be saved as JsonArray
fieldName
- the name of the field to be usedSet the name of the field to be used for the roles. Defaults to MongoAuth. Roles are expected to be saved as JsonArray
fieldName
- the name of the field to be usedSet the name of the field to be used for the salt. Only used when HashStrategy.setSaltStyle is set to
fieldName
- the name of the field to be usedSet the name of the field to be used as property for the username in the method AuthProvider.authenticate. Defaults to MongoAuth
fieldName
- the name of the field to be used