Search in sources :

Example 1 with MongoAuth

use of io.vertx.ext.auth.mongo.MongoAuth in project vertx-auth by vert-x3.

the class AuthMongoExamples method example1.

public void example1(Vertx vertx, JsonObject mongoClientConfig) {
    MongoClient client = MongoClient.createShared(vertx, mongoClientConfig);
    JsonObject authProperties = new JsonObject();
    MongoAuth authProvider = MongoAuth.create(client, authProperties);
}
Also used : MongoClient(io.vertx.ext.mongo.MongoClient) JsonObject(io.vertx.core.json.JsonObject) MongoAuth(io.vertx.ext.auth.mongo.MongoAuth)

Example 2 with MongoAuth

use of io.vertx.ext.auth.mongo.MongoAuth in project vertx-auth by vert-x3.

the class MongoAuthPBKDF2Test method createProvider.

@Override
protected MongoAuth createProvider() throws Exception {
    JsonObject config = new JsonObject();
    config.put(MongoAuth.PROPERTY_COLLECTION_NAME, createCollectionName(MongoAuth.DEFAULT_COLLECTION_NAME));
    config.put(MongoAuth.PROPERTY_SALT_STYLE, HashSaltStyle.COLUMN);
    MongoAuth mongoAuth = MongoAuth.create(getMongoClient(), config);
    mongoAuth.getHashStrategy().setAlgorithm(HashAlgorithm.PBKDF2);
    return mongoAuth;
}
Also used : JsonObject(io.vertx.core.json.JsonObject) MongoAuth(io.vertx.ext.auth.mongo.MongoAuth)

Example 3 with MongoAuth

use of io.vertx.ext.auth.mongo.MongoAuth in project vertx-auth by vert-x3.

the class AuthMongoExamples method example5.

public void example5(Vertx vertx, JsonObject mongoClientConfig) {
    MongoClient client = MongoClient.createShared(vertx, mongoClientConfig);
    JsonObject authProperties = new JsonObject();
    MongoAuth authProvider = MongoAuth.create(client, authProperties);
    authProvider.setHashAlgorithm(HashAlgorithm.PBKDF2);
}
Also used : MongoClient(io.vertx.ext.mongo.MongoClient) JsonObject(io.vertx.core.json.JsonObject) MongoAuth(io.vertx.ext.auth.mongo.MongoAuth)

Aggregations

JsonObject (io.vertx.core.json.JsonObject)3 MongoAuth (io.vertx.ext.auth.mongo.MongoAuth)3 MongoClient (io.vertx.ext.mongo.MongoClient)2