Search in sources :

Example 1 with PasswordEncoder

use of org.pac4j.core.credentials.password.PasswordEncoder in project pac4j by pac4j.

the class DbProfileService method internalInit.

@Override
protected void internalInit(final boolean forceReinit) {
    assertNotNull("passwordEncoder", getPasswordEncoder());
    assertNotNull("dataSource", this.dataSource);
    this.dbi = new DBI(this.dataSource);
    defaultProfileDefinition(new CommonProfileDefinition(x -> new DbProfile()));
    setSerializer(new JsonSerializer(DbProfile.class));
    super.internalInit(forceReinit);
}
Also used : AbstractProfileService(org.pac4j.core.profile.service.AbstractProfileService) List(java.util.List) Handle(org.skife.jdbi.v2.Handle) PasswordEncoder(org.pac4j.core.credentials.password.PasswordEncoder) CommonProfileDefinition(org.pac4j.core.profile.definition.CommonProfileDefinition) DbProfile(org.pac4j.sql.profile.DbProfile) DBI(org.skife.jdbi.v2.DBI) Map(java.util.Map) DataSource(javax.sql.DataSource) CommonHelper(org.pac4j.core.util.CommonHelper) JsonSerializer(org.pac4j.core.util.serializer.JsonSerializer) ArrayList(java.util.ArrayList) DBI(org.skife.jdbi.v2.DBI) JsonSerializer(org.pac4j.core.util.serializer.JsonSerializer) DbProfile(org.pac4j.sql.profile.DbProfile) CommonProfileDefinition(org.pac4j.core.profile.definition.CommonProfileDefinition)

Example 2 with PasswordEncoder

use of org.pac4j.core.credentials.password.PasswordEncoder in project pac4j by pac4j.

the class DbProfileService method internalInit.

@Override
protected void internalInit() {
    CommonHelper.assertNotNull("passwordEncoder", getPasswordEncoder());
    defaultProfileDefinition(new CommonProfileDefinition<>(x -> new DbProfile()));
    CommonHelper.assertNotNull("dataSource", this.dataSource);
    this.dbi = new DBI(this.dataSource);
    super.internalInit();
}
Also used : AbstractProfileService(org.pac4j.core.profile.service.AbstractProfileService) List(java.util.List) Handle(org.skife.jdbi.v2.Handle) PasswordEncoder(org.pac4j.core.credentials.password.PasswordEncoder) CommonProfileDefinition(org.pac4j.core.profile.definition.CommonProfileDefinition) DbProfile(org.pac4j.sql.profile.DbProfile) DBI(org.skife.jdbi.v2.DBI) Map(java.util.Map) DataSource(javax.sql.DataSource) CommonHelper(org.pac4j.core.util.CommonHelper) ArrayList(java.util.ArrayList) DBI(org.skife.jdbi.v2.DBI) DbProfile(org.pac4j.sql.profile.DbProfile)

Example 3 with PasswordEncoder

use of org.pac4j.core.credentials.password.PasswordEncoder in project pac4j by pac4j.

the class CouchProfileService method internalInit.

@Override
protected void internalInit(final boolean forceReinit) {
    assertNotNull("passwordEncoder", getPasswordEncoder());
    assertNotNull("couchDbConnector", this.couchDbConnector);
    defaultProfileDefinition(new CommonProfileDefinition(x -> new CouchProfile()));
    setSerializer(new JsonSerializer(CouchProfile.class));
    super.internalInit(forceReinit);
}
Also used : AbstractProfileService(org.pac4j.core.profile.service.AbstractProfileService) ViewQuery(org.ektorp.ViewQuery) CouchProfile(org.pac4j.couch.profile.CouchProfile) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) IOException(java.io.IOException) HashMap(java.util.HashMap) DocumentNotFoundException(org.ektorp.DocumentNotFoundException) JsonSerializer(org.pac4j.core.util.serializer.JsonSerializer) ArrayList(java.util.ArrayList) List(java.util.List) PasswordEncoder(org.pac4j.core.credentials.password.PasswordEncoder) CommonProfileDefinition(org.pac4j.core.profile.definition.CommonProfileDefinition) Map(java.util.Map) CommonHelper(org.pac4j.core.util.CommonHelper) TypeReference(com.fasterxml.jackson.core.type.TypeReference) CouchDbConnector(org.ektorp.CouchDbConnector) CouchProfile(org.pac4j.couch.profile.CouchProfile) JsonSerializer(org.pac4j.core.util.serializer.JsonSerializer) CommonProfileDefinition(org.pac4j.core.profile.definition.CommonProfileDefinition)

Example 4 with PasswordEncoder

use of org.pac4j.core.credentials.password.PasswordEncoder in project pac4j by pac4j.

the class MongoProfileService method internalInit.

@Override
protected void internalInit(final boolean forceReinit) {
    CommonHelper.assertNotNull("passwordEncoder", getPasswordEncoder());
    CommonHelper.assertNotNull("mongoClient", this.mongoClient);
    CommonHelper.assertNotBlank("usersDatabase", this.usersDatabase);
    CommonHelper.assertNotBlank("usersCollection", this.usersCollection);
    defaultProfileDefinition(new CommonProfileDefinition(x -> new MongoProfile()));
    setSerializer(new JsonSerializer(MongoProfile.class));
    super.internalInit(forceReinit);
}
Also used : Document(org.bson.Document) AbstractProfileService(org.pac4j.core.profile.service.AbstractProfileService) MongoClient(com.mongodb.client.MongoClient) MongoCollection(com.mongodb.client.MongoCollection) MongoProfile(org.pac4j.mongo.profile.MongoProfile) HashMap(java.util.HashMap) JsonSerializer(org.pac4j.core.util.serializer.JsonSerializer) ArrayList(java.util.ArrayList) Filters(com.mongodb.client.model.Filters) List(java.util.List) PasswordEncoder(org.pac4j.core.credentials.password.PasswordEncoder) CommonProfileDefinition(org.pac4j.core.profile.definition.CommonProfileDefinition) Map(java.util.Map) CommonHelper(org.pac4j.core.util.CommonHelper) JsonSerializer(org.pac4j.core.util.serializer.JsonSerializer) MongoProfile(org.pac4j.mongo.profile.MongoProfile) CommonProfileDefinition(org.pac4j.core.profile.definition.CommonProfileDefinition)

Aggregations

ArrayList (java.util.ArrayList)4 List (java.util.List)4 Map (java.util.Map)4 PasswordEncoder (org.pac4j.core.credentials.password.PasswordEncoder)4 CommonProfileDefinition (org.pac4j.core.profile.definition.CommonProfileDefinition)4 AbstractProfileService (org.pac4j.core.profile.service.AbstractProfileService)4 CommonHelper (org.pac4j.core.util.CommonHelper)4 JsonSerializer (org.pac4j.core.util.serializer.JsonSerializer)3 HashMap (java.util.HashMap)2 DataSource (javax.sql.DataSource)2 DbProfile (org.pac4j.sql.profile.DbProfile)2 DBI (org.skife.jdbi.v2.DBI)2 Handle (org.skife.jdbi.v2.Handle)2 TypeReference (com.fasterxml.jackson.core.type.TypeReference)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 MongoClient (com.mongodb.client.MongoClient)1 MongoCollection (com.mongodb.client.MongoCollection)1 Filters (com.mongodb.client.model.Filters)1 IOException (java.io.IOException)1 Document (org.bson.Document)1