Search in sources :

Example 1 with JsonSerializer

use of org.pac4j.core.util.serializer.JsonSerializer in project pac4j by pac4j.

the class InMemoryProfileService method internalInit.

@Override
protected void internalInit(final boolean forceReinit) {
    assertNotNull("passwordEncoder", getPasswordEncoder());
    defaultProfileDefinition(new CommonProfileDefinition(profileFactory));
    setSerializer(new JsonSerializer(CommonProfile.class));
    super.internalInit(forceReinit);
}
Also used : CommonProfile(org.pac4j.core.profile.CommonProfile) JsonSerializer(org.pac4j.core.util.serializer.JsonSerializer) CommonProfileDefinition(org.pac4j.core.profile.definition.CommonProfileDefinition)

Example 2 with JsonSerializer

use of org.pac4j.core.util.serializer.JsonSerializer 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 3 with JsonSerializer

use of org.pac4j.core.util.serializer.JsonSerializer in project pac4j by pac4j.

the class LdapProfileService method internalInit.

@Override
protected void internalInit(final boolean forceReinit) {
    assertNotNull("ldapAuthenticator", ldapAuthenticator);
    assertNotNull("connectionFactory", connectionFactory);
    assertNull("passwordEncoder", getPasswordEncoder());
    assertNotBlank("usersDn", usersDn);
    defaultProfileDefinition(new CommonProfileDefinition(x -> new LdapProfile()));
    setSerializer(new JsonSerializer(LdapProfile.class));
    super.internalInit(forceReinit);
}
Also used : UsernamePasswordCredentials(org.pac4j.core.credentials.UsernamePasswordCredentials) ResultPredicate(org.ldaptive.handler.ResultPredicate) AbstractProfileService(org.pac4j.core.profile.service.AbstractProfileService) java.util(java.util) org.pac4j.core.exception(org.pac4j.core.exception) SessionStore(org.pac4j.core.context.session.SessionStore) Pac4jConstants(org.pac4j.core.util.Pac4jConstants) JsonSerializer(org.pac4j.core.util.serializer.JsonSerializer) WebContext(org.pac4j.core.context.WebContext) LdapProfile(org.pac4j.ldap.profile.LdapProfile) CommonProfileDefinition(org.pac4j.core.profile.definition.CommonProfileDefinition) CommonHelper(org.pac4j.core.util.CommonHelper) Credentials(org.pac4j.core.credentials.Credentials) org.ldaptive(org.ldaptive) org.ldaptive.auth(org.ldaptive.auth) JsonSerializer(org.pac4j.core.util.serializer.JsonSerializer) LdapProfile(org.pac4j.ldap.profile.LdapProfile) CommonProfileDefinition(org.pac4j.core.profile.definition.CommonProfileDefinition)

Example 4 with JsonSerializer

use of org.pac4j.core.util.serializer.JsonSerializer 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 5 with JsonSerializer

use of org.pac4j.core.util.serializer.JsonSerializer 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

CommonProfileDefinition (org.pac4j.core.profile.definition.CommonProfileDefinition)5 JsonSerializer (org.pac4j.core.util.serializer.JsonSerializer)5 AbstractProfileService (org.pac4j.core.profile.service.AbstractProfileService)4 CommonHelper (org.pac4j.core.util.CommonHelper)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Map (java.util.Map)3 PasswordEncoder (org.pac4j.core.credentials.password.PasswordEncoder)3 HashMap (java.util.HashMap)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 java.util (java.util)1 DataSource (javax.sql.DataSource)1 Document (org.bson.Document)1 CouchDbConnector (org.ektorp.CouchDbConnector)1 DocumentNotFoundException (org.ektorp.DocumentNotFoundException)1