Search in sources :

Example 11 with LDAPQueryConditionsBuilder

use of org.keycloak.storage.ldap.idm.query.internal.LDAPQueryConditionsBuilder in project keycloak by keycloak.

the class GroupLDAPStorageMapper method loadLDAPGroupByName.

public LDAPObject loadLDAPGroupByName(String groupName) {
    try (LDAPQuery ldapQuery = createGroupQuery(true)) {
        Condition roleNameCondition = new LDAPQueryConditionsBuilder().equal(config.getGroupNameLdapAttribute(), groupName);
        ldapQuery.addWhereCondition(roleNameCondition);
        return ldapQuery.getFirstResult();
    }
}
Also used : Condition(org.keycloak.storage.ldap.idm.query.Condition) LDAPQuery(org.keycloak.storage.ldap.idm.query.internal.LDAPQuery) LDAPQueryConditionsBuilder(org.keycloak.storage.ldap.idm.query.internal.LDAPQueryConditionsBuilder)

Example 12 with LDAPQueryConditionsBuilder

use of org.keycloak.storage.ldap.idm.query.internal.LDAPQueryConditionsBuilder in project keycloak by keycloak.

the class RoleLDAPStorageMapper method loadLDAPRoleByName.

public LDAPObject loadLDAPRoleByName(String roleName) {
    try (LDAPQuery ldapQuery = createRoleQuery(true)) {
        Condition roleNameCondition = new LDAPQueryConditionsBuilder().equal(config.getRoleNameLdapAttribute(), roleName);
        ldapQuery.addWhereCondition(roleNameCondition);
        return ldapQuery.getFirstResult();
    }
}
Also used : Condition(org.keycloak.storage.ldap.idm.query.Condition) LDAPQuery(org.keycloak.storage.ldap.idm.query.internal.LDAPQuery) LDAPQueryConditionsBuilder(org.keycloak.storage.ldap.idm.query.internal.LDAPQueryConditionsBuilder)

Aggregations

Condition (org.keycloak.storage.ldap.idm.query.Condition)12 LDAPQuery (org.keycloak.storage.ldap.idm.query.internal.LDAPQuery)12 LDAPQueryConditionsBuilder (org.keycloak.storage.ldap.idm.query.internal.LDAPQueryConditionsBuilder)12 LDAPObject (org.keycloak.storage.ldap.idm.model.LDAPObject)3 ArrayList (java.util.ArrayList)1 ComponentModel (org.keycloak.component.ComponentModel)1 UserModel (org.keycloak.models.UserModel)1 CachedUserModel (org.keycloak.models.cache.CachedUserModel)1 SynchronizationResult (org.keycloak.storage.user.SynchronizationResult)1