Class LdapIdentityProviderSession
java.lang.Object
org.camunda.bpm.identity.impl.ldap.LdapIdentityProviderSession
- All Implemented Interfaces:
ReadOnlyIdentityProvider
,Session
LDAP ReadOnlyIdentityProvider
.
- Author:
- Daniel Meyer
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addFilter
(String attributeName, String attributeValue, StringWriter writer) boolean
checkPassword
(String userId, String password) void
close()
protected String
createGroupQuery
(CommandContext commandContext) Creates aNativeUserQuery
that allows to select users with native queries.createTenantQuery
(CommandContext commandContext) createUserQuery
(CommandContext commandContext) protected final String
escapeLDAPSearchFilter
(String filter) findGroupById
(String groupId) long
findGroupCountByQueryCriteria
(LdapGroupQuery ldapGroupQuery) findTenantById
(String id) findUserById
(String userId) long
findUsersWithoutGroupId
(LdapUserQueryImpl query, String userBaseDn, boolean ignorePagination) void
flush()
protected String
getDnForGroup
(String groupId) protected String
getDnForUser
(String userId) protected String
protected Integer
Return the pageSize.getSortingControls
(AbstractQuery<?, ?> query) Return the list of Controls requested in the query.protected SortKey
getSortKey
(AbstractQuery<?, ?> query, String propertyName, QueryOrderingProperty orderingProperty) protected String
protected void
initializeControls
(AbstractQuery<?, ?> query) Initializes paged results and sort controls.protected boolean
isAuthenticatedAndAuthorized
(String userId) protected boolean
isAuthenticatedUser
(String userid) protected boolean
isAuthorizedToRead
(Resource resource, String resourceId) protected boolean
isAuthorizedToReadGroup
(String groupId) protected boolean
protected boolean
Check in the context if we reach the last page on the queryprotected boolean
paginationContinues
(int currentSize, int maxResults) retrieveResults
(String baseDn, String filter, Function<SearchResult, E> transformEntity, Predicate<String> resultCountPredicate, int maxResults, int firstResult, boolean ignorePagination) protected GroupEntity
transformGroup
(SearchResult result) protected UserEntity
transformUser
(SearchResult result)
-
Field Details
-
ldapConfiguration
-
ldapClient
-
-
Constructor Details
-
LdapIdentityProviderSession
-
-
Method Details
-
flush
public void flush() -
close
public void close() -
findUserById
- Specified by:
findUserById
in interfaceReadOnlyIdentityProvider
- Returns:
- a
User
object for the given user id or null if no such user exists.
-
createUserQuery
- Specified by:
createUserQuery
in interfaceReadOnlyIdentityProvider
- Returns:
- a
UserQuery
object which can be used for querying for users.
-
createUserQuery
- Specified by:
createUserQuery
in interfaceReadOnlyIdentityProvider
- Returns:
- a
UserQuery
object which can be used in the current command context
-
createNativeUserQuery
Description copied from interface:ReadOnlyIdentityProvider
Creates aNativeUserQuery
that allows to select users with native queries.- Specified by:
createNativeUserQuery
in interfaceReadOnlyIdentityProvider
- Returns:
- NativeUserQuery
-
findUserCountByQueryCriteria
-
findUserByQueryCriteria
-
paginationContinues
protected boolean paginationContinues(int currentSize, int maxResults) -
findUsersByGroupId
-
checkPassword
- Specified by:
checkPassword
in interfaceReadOnlyIdentityProvider
- Returns:
- 'true' if the password matches the
-
getUserSearchFilter
-
isAuthenticatedAndAuthorized
-
findUsersWithoutGroupId
public List<User> findUsersWithoutGroupId(LdapUserQueryImpl query, String userBaseDn, boolean ignorePagination) -
findGroupById
- Specified by:
findGroupById
in interfaceReadOnlyIdentityProvider
- Returns:
- a
Group
object for the given group id or null if no such group exists.
-
createGroupQuery
- Specified by:
createGroupQuery
in interfaceReadOnlyIdentityProvider
- Returns:
- a
GroupQuery
object which can be used for querying for groups.
-
createGroupQuery
- Specified by:
createGroupQuery
in interfaceReadOnlyIdentityProvider
- Returns:
- a
GroupQuery
object which can be used for querying for groups and can be reused in the current command context.
-
findGroupCountByQueryCriteria
-
isAuthorizedToReadGroup
-
findGroupByQueryCriteria
-
getGroupSearchFilter
-
retrieveResults
-
getDnForUser
-
getDnForGroup
-
addFilter
-
transformUser
-
transformGroup
-
getSortingControls
Return the list of Controls requested in the query. Query may be run on USERS or on GROUP- Parameters:
query
- query asks, contains the order by requested- Returns:
- list of control to send to LDAP
-
getSortKey
protected SortKey getSortKey(AbstractQuery<?, ?> query, String propertyName, QueryOrderingProperty orderingProperty) -
composeDn
-
isAuthenticatedUser
- Returns:
- true if the passed-in user is currently authenticated
-
isAuthorizedToRead
-
escapeLDAPSearchFilter
-
initializeControls
Initializes paged results and sort controls. Might not be supported by all LDAP implementations. -
nextPageDetected
protected boolean nextPageDetected()Check in the context if we reach the last page on the query- Returns:
- new page detected
-
isPaginationSupported
protected boolean isPaginationSupported() -
getPageSize
Return the pageSize. Returns null if pagination is disabled.- Returns:
- the pageSize
-
createTenantQuery
- Specified by:
createTenantQuery
in interfaceReadOnlyIdentityProvider
- Returns:
- a
TenantQuery
object which can be used for querying for tenants.
-
createTenantQuery
- Specified by:
createTenantQuery
in interfaceReadOnlyIdentityProvider
- Returns:
- a
TenantQuery
object which can be used for querying for tenants and can be reused in the current command context.
-
findTenantById
- Specified by:
findTenantById
in interfaceReadOnlyIdentityProvider
- Returns:
- a
Tenant
object for the given id or null if no such tenant exists.
-