public class MongoAuth extends AuthProvider
original non RX-ified interface using Vert.x codegen.| Modifier and Type | Method and Description |
|---|---|
static MongoAuth |
create(MongoClient mongoClient,
JsonObject config)
Creates an instance of MongoAuth by using the given and configuration object.
|
String |
getCollectionName()
The name of the collection used to store User objects inside.
|
Object |
getDelegate() |
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. |
String |
getPasswordField()
Get the name of the field to be used for the password Defaults to
MongoAuth |
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. |
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
|
rx.Observable<String> |
insertUserObservable(String username,
String password,
List<String> roles,
List<String> permissions)
Insert a new user into mongo in the convenient way
|
static MongoAuth |
newInstance(MongoAuth arg) |
MongoAuth |
setCollectionName(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(String fieldName)
Set the name of the field to be used as property for the password of credentials in the method
AuthProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>). |
MongoAuth |
setPasswordField(String fieldName)
Set the name of the field to be used for the password Defaults to
MongoAuth |
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(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>). |
MongoAuth |
setUsernameField(String fieldName)
Set the name of the field to be used for the username.
|
authenticate, authenticateObservable, newInstancepublic MongoAuth(MongoAuth delegate)
public Object getDelegate()
getDelegate in class AuthProviderpublic static MongoAuth create(MongoClient mongoClient, JsonObject config)
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 thisMongoAuthspublic MongoAuth setCollectionName(String collectionName)
MongoAuthcollectionName - the name of the collection to be used for storing and reading user datapublic MongoAuth setUsernameField(String fieldName)
MongoAuthfieldName - the name of the field to be usedpublic MongoAuth setPasswordField(String fieldName)
MongoAuthfieldName - the name of the field to be usedpublic MongoAuth setRoleField(String fieldName)
MongoAuth. Roles are expected to
be saved as JsonArrayfieldName - the name of the field to be usedpublic MongoAuth setPermissionField(String fieldName)
MongoAuth.
Permissions are expected to be saved as JsonArrayfieldName - the name of the field to be usedpublic MongoAuth setUsernameCredentialField(String fieldName)
AuthProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>). Defaults to MongoAuthfieldName - the name of the field to be usedpublic MongoAuth setPasswordCredentialField(String fieldName)
AuthProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>). Defaults to MongoAuthfieldName - the name of the field to be usedpublic MongoAuth setSaltField(String fieldName)
HashStrategy.setSaltStyle(io.vertx.ext.auth.mongo.HashSaltStyle) is
set tofieldName - the name of the field to be usedpublic String getCollectionName()
MongoAuthpublic String getUsernameField()
MongoAuthpublic String getPasswordField()
MongoAuthpublic String getRoleField()
MongoAuth. Roles are expected to
be saved as JsonArraypublic String getPermissionField()
MongoAuth.
Permissions are expected to be saved as JsonArraypublic String getUsernameCredentialField()
AuthProvider. Defaults to MongoAuthpublic String getPasswordCredentialField()
AuthProvider. Defaults to MongoAuthpublic String getSaltField()
HashStrategy is
set topublic MongoAuth setHashStrategy(HashStrategy hashStrategy)
hashStrategy - the HashStrategy to be setpublic HashStrategy getHashStrategy()
HashStrategypublic void 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 recordpublic rx.Observable<String> insertUserObservable(String username, String password, List<String> roles, List<String> permissions)
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 setCopyright © 2015. All rights reserved.