Class LdapIdentityProviderSession
java.lang.Object
org.camunda.bpm.identity.impl.ldap.LdapIdentityProviderSession
- All Implemented Interfaces:
ReadOnlyIdentityProvider,Session
LDAP ReadOnlyIdentityProvider.
- Author:
- Daniel Meyer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddFilter(String attributeName, String attributeValue, StringWriter writer) booleancheckPassword(String userId, String password) voidclose()protected StringcreateGroupQuery(CommandContext commandContext) Creates aNativeUserQuerythat allows to select users with native queries.createTenantQuery(CommandContext commandContext) createUserQuery(CommandContext commandContext) protected final StringescapeLDAPSearchFilter(String filter) findGroupById(String groupId) longfindGroupCountByQueryCriteria(LdapGroupQuery ldapGroupQuery) findTenantById(String id) findUserById(String userId) longfindUsersWithoutGroupId(LdapUserQueryImpl query, String userBaseDn, boolean ignorePagination) voidflush()protected StringgetDnForGroup(String groupId) protected StringgetDnForUser(String userId) protected Stringprotected IntegerReturn the pageSize.getSortingControls(AbstractQuery<?, ?> query) Return the list of Controls requested in the query.protected SortKeygetSortKey(AbstractQuery<?, ?> query, String propertyName, QueryOrderingProperty orderingProperty) protected Stringprotected voidinitializeControls(AbstractQuery<?, ?> query) Initializes paged results and sort controls.protected booleanisAuthenticatedAndAuthorized(String userId) protected booleanisAuthenticatedUser(String userid) protected booleanisAuthorizedToRead(Resource resource, String resourceId) protected booleanisAuthorizedToReadGroup(String groupId) protected booleanprotected booleanCheck in the context if we reach the last page on the queryprotected booleanpaginationContinues(int currentSize, int maxResults) retrieveResults(String baseDn, String filter, Function<SearchResult, E> transformEntity, Predicate<String> resultCountPredicate, int maxResults, int firstResult, boolean ignorePagination) protected GroupEntitytransformGroup(SearchResult result) protected UserEntitytransformUser(SearchResult result)
-
Field Details
-
ldapConfiguration
-
ldapClient
-
-
Constructor Details
-
LdapIdentityProviderSession
-
-
Method Details
-
flush
public void flush() -
close
public void close() -
findUserById
- Specified by:
findUserByIdin interfaceReadOnlyIdentityProvider- Returns:
- a
Userobject for the given user id or null if no such user exists.
-
createUserQuery
- Specified by:
createUserQueryin interfaceReadOnlyIdentityProvider- Returns:
- a
UserQueryobject which can be used for querying for users.
-
createUserQuery
- Specified by:
createUserQueryin interfaceReadOnlyIdentityProvider- Returns:
- a
UserQueryobject which can be used in the current command context
-
createNativeUserQuery
Description copied from interface:ReadOnlyIdentityProviderCreates aNativeUserQuerythat allows to select users with native queries.- Specified by:
createNativeUserQueryin interfaceReadOnlyIdentityProvider- Returns:
- NativeUserQuery
-
findUserCountByQueryCriteria
-
findUserByQueryCriteria
-
paginationContinues
protected boolean paginationContinues(int currentSize, int maxResults) -
findUsersByGroupId
-
checkPassword
- Specified by:
checkPasswordin interfaceReadOnlyIdentityProvider- Returns:
- 'true' if the password matches the
-
getUserSearchFilter
-
isAuthenticatedAndAuthorized
-
findUsersWithoutGroupId
public List<User> findUsersWithoutGroupId(LdapUserQueryImpl query, String userBaseDn, boolean ignorePagination) -
findGroupById
- Specified by:
findGroupByIdin interfaceReadOnlyIdentityProvider- Returns:
- a
Groupobject for the given group id or null if no such group exists.
-
createGroupQuery
- Specified by:
createGroupQueryin interfaceReadOnlyIdentityProvider- Returns:
- a
GroupQueryobject which can be used for querying for groups.
-
createGroupQuery
- Specified by:
createGroupQueryin interfaceReadOnlyIdentityProvider- Returns:
- a
GroupQueryobject 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:
createTenantQueryin interfaceReadOnlyIdentityProvider- Returns:
- a
TenantQueryobject which can be used for querying for tenants.
-
createTenantQuery
- Specified by:
createTenantQueryin interfaceReadOnlyIdentityProvider- Returns:
- a
TenantQueryobject which can be used for querying for tenants and can be reused in the current command context.
-
findTenantById
- Specified by:
findTenantByIdin interfaceReadOnlyIdentityProvider- Returns:
- a
Tenantobject for the given id or null if no such tenant exists.
-