Class LdapIdentityProviderSession

    • Field Detail

      • initialContext

        protected javax.naming.ldap.LdapContext initialContext
    • Constructor Detail

      • LdapIdentityProviderSession

        public LdapIdentityProviderSession​(LdapConfiguration ldapConfiguration)
    • Method Detail

      • flush

        public void flush()
        Specified by:
        flush in interface Session
      • close

        public void close()
        Specified by:
        close in interface Session
      • closeLdapCtx

        protected void closeLdapCtx​(javax.naming.ldap.LdapContext context)
      • openContext

        protected javax.naming.ldap.InitialLdapContext openContext​(java.lang.String userDn,
                                                                   java.lang.String password)
      • ensureContextInitialized

        protected void ensureContextInitialized()
      • findUserCountByQueryCriteria

        public long findUserCountByQueryCriteria​(LdapUserQueryImpl query)
      • findUserByQueryCriteria

        public java.util.List<User> findUserByQueryCriteria​(LdapUserQueryImpl query)
      • findUsersWithoutGroupId

        public java.util.List<User> findUsersWithoutGroupId​(LdapUserQueryImpl query,
                                                            java.lang.String userBaseDn,
                                                            boolean ignorePagination)
      • checkPassword

        public boolean checkPassword​(java.lang.String userId,
                                     java.lang.String password)
        Specified by:
        checkPassword in interface ReadOnlyIdentityProvider
        Returns:
        'true' if the password matches the
      • getUserSearchFilter

        protected java.lang.String getUserSearchFilter​(LdapUserQueryImpl query)
      • findGroupCountByQueryCriteria

        public long findGroupCountByQueryCriteria​(LdapGroupQuery ldapGroupQuery)
      • findGroupByQueryCriteria

        public java.util.List<Group> findGroupByQueryCriteria​(LdapGroupQuery query)
      • getGroupSearchFilter

        protected java.lang.String getGroupSearchFilter​(LdapGroupQuery query)
      • getDnForUser

        protected java.lang.String getDnForUser​(java.lang.String userId)
      • getDnForGroup

        protected java.lang.String getDnForGroup​(java.lang.String groupId)
      • getStringAttributeValue

        protected java.lang.String getStringAttributeValue​(java.lang.String attrName,
                                                           javax.naming.directory.Attributes attributes)
                                                    throws javax.naming.NamingException
        Throws:
        javax.naming.NamingException
      • addFilter

        protected void addFilter​(java.lang.String attributeName,
                                 java.lang.String attributeValue,
                                 java.io.StringWriter writer)
      • transformUser

        protected LdapUserEntity transformUser​(javax.naming.directory.SearchResult result)
                                        throws javax.naming.NamingException
        Throws:
        javax.naming.NamingException
      • transformGroup

        protected GroupEntity transformGroup​(javax.naming.directory.SearchResult result)
                                      throws javax.naming.NamingException
        Throws:
        javax.naming.NamingException
      • applyRequestControls

        protected void applyRequestControls​(AbstractQuery<?,​?> query)
      • composeDn

        protected java.lang.String composeDn​(java.lang.String... parts)
      • isAuthenticatedUser

        protected boolean isAuthenticatedUser​(UserEntity user)
        Returns:
        true if the passed-in user is currently authenticated
      • isAuthorized

        protected boolean isAuthorized​(Permission permission,
                                       Resource resource,
                                       java.lang.String resourceId)
      • escapeLDAPSearchFilter

        protected final java.lang.String escapeLDAPSearchFilter​(java.lang.String filter)