LDAPClient difference wtih ISVA
Differences between the LDAP classes and traditional Verify Access LDAP classes
Input argument and return value type differences
1. List type
JS array is used instead of java.util.List
.
- Input argument: use JavaScript array to create the variable.
var attrUtil = new LdapAttributeUtil("ldap");
// getAttributeValue
let attrList = ["objectClass", "description"]
let result = attrUtil.getAttributeValue("ou=newOu", attrList);
// do something
- Return value: access the return values as JavaScript array
var userLookupHelper = new UserLookupHelper("ldap");
let results = userLookupHelper.search("givenName", "Scott", 5);
if (results != null) {
for (let i = 0; i < results.length; i++) {
let result = results[i];
// Do something...
}
}
2. Map type
JS object is used instead of java.util.Map
- Input argument: use JavaScript object to create the variable.
var attrUtil = new LdapAttributeUtil("ldap");
// createSubContext
let attrMap = {"objectClass": ["top", "organizationalUnit"]}
let result = attrUtil.createSubContext("ou=newOu", attrMap);
// do something
3. LdapOperationResult and subtypes
LdapAttributeUtil
methods use LdapAttributeResult
as the return type instead of using subtype classes of com.ibm.security.access.ldap.LdapOperationResult
.
- Return value: LDAP classes do not have Map type return value
API differences
1. UserLookupHelper
vs com.ibm.security.access.user.UserLookupHelper
UserLookupHelper
vs com.ibm.security.access.user.UserLookupHelper
- Constructors:
UserLookupHelper
takes in one argument, which indicate which ldap configuration to use. If it's not specified, the default configuration nameldap
will be used.
Refer to storage configure guide for ldap configuration. - Supported methods: Uses same input arguments as
com.ibm.security.access.user.UserLookupHelper
getUser
getUserByNativeId
- Supported but incompatible methods: The following methods from
com.ibm.security.access.user.UserLookupHelper
are functionally supported byUserLookupHelper
, but incompatible to the original method due to input arguments differences.createUser
: The signatures are different.deleteUser
: Supports the first argumentusername
only. TheremoveNativeUser
argument is ignored if provided.init
: Tests the ldap connection only, does not perform ldap initialization. Returnstrue
if the test connection succeeded, otherwise returnsfalse
. Refer toUserLookupHelper
Constructors to connect different ldap.isReady
: Test the ldap connection. Returnstrue
if the test connection succeeded, otherwise returnsfalse
search
: Supports the first three argumentssearchAttr
,attrPattern
, andmaxReturned
only. ThepageSize
argument is ignored if provided.
- Unsupported methods:
shutdown
2. User
compared to com.ibm.security.access.user.User
User
compared to com.ibm.security.access.user.User
- Constructors: Not applicable
- Supported methods: Uses same input arguments as
com.ibm.security.access.user.User
.
Also, refer to Input Argument and Return Value Type Differences for return type differencesauthenticate
getId
getNativeId
getAttributeNames
getAttribute
getAttributes
getErrMessage
attributeExists
- Unsupported methods:
addAttribute
addToGroup
changePassword
clearError
getGroups
getNativeGroups
isAccountDisabled
isAccountLocked
isAccountValid
isCredentialsValid
isPasswordCharsValid
isPasswordContainsRepeatedChars
isPasswordContainsSpaces
isPasswordExpiringSoon
isPasswordMissingAlphaChars
isPasswordMissingNonAlphaChars
isPasswordTooShort
isPasswordValid
isValidTimeOfDayAccess
removeAttribute
removeFromGroup
replaceAttribut
setPassword
wasAccountJustDisabled
wasAccountJustLocked
wasOldPasswordValid
- New methods:
User
provides these new methodshasError
getError
3. LdapAttributeUtil
vs com.ibm.security.access.ldap.utils.AttributeUtil
LdapAttributeUtil
vs com.ibm.security.access.ldap.utils.AttributeUtil
- Constructors:
LdapAttributeUtil
takes in one argument, which indicate which ldap configuration to use. If it's not specified, the default configuration nameldap
will be used.
Refer to storage configure guide for ldap configuration. - Supported methods: Uses same input arguments as
com.ibm.security.access.ldap.utils.AttributeUtil
addAttributeValue
getAttributeValue
removeAttribute
search
setAttributeValue
- Supported but incompatible methods: The following methods from
com.ibm.security.access.ldap.utils.AttributeUtil
are functionally supported byLdapAttributeUtil
, but incompatible to the original method due to input arguments differencescreateSubContext
: The type of second argumentattributes
is JavaScript Object instead ofjavax.naming.directory.Attributes
init
: Tests the ldap connection only, it does not perform ldap initialization.- Use
hasError
orisSuccessful
on the returnedLdapAttributeResult
instance to check whether the test connection succeeded. - Use
getError
orgetNamingException
on the returnedLdapAttributeResult
instance to retrieve the error details.
Refer toLdapAttributeUtil
Constructors to connect different ldap
- Use
- Unsupported methods:
ldapAttributeGetResultToAttributeGetResult
4. LdapAttributeResult
compared to com.ibm.security.access.ldap.LdapOperationResult
and its subtypes
LdapAttributeResult
compared to com.ibm.security.access.ldap.LdapOperationResult
and its subtypes- Constructors: Not applicable
- Supported methods:
isSuccessful
getNamingException
getAttributes
getNamingEnumeration
- Unsupported methods: The following methods from
com.ibm.security.access.ldap.LdapOperationResult
and its subtypes are NOT supported byLdapAttributeResult
getResponseControls
toString
getCreatedContext
- New methods:
LdapAttributeResult
provides these new methodshasError
getError
5. Attributes
compared to javax.naming.directory.Attributes
Attributes
compared to javax.naming.directory.Attributes
- Constructors: Not to be instantiated by the user
- Supported methods: Uses same input arguments as
javax.naming.directory.Attributes
get
getIDs
getAll
isCaseIgnored
size
- Unsupported methods:
clone
put
remove
6. Attribute
compared to javax.naming.directory.Attribute
Attribute
compared to javax.naming.directory.Attribute
- Constructors: Not to be instantiated by the user
- Supported methods: Uses same input arguments as
javax.naming.directory.Attribute
contains
isOrdered
size
getID
get
getAll
- Unsupported methods:
clone
add
clear
remove
set
7. SearchResult
compared to javax.naming.directory.SearchResult
SearchResult
compared to javax.naming.directory.SearchResult
- Constructors: Not to be instantiated by the user
- Supported methods: Uses same input arguments as
javax.naming.directory.SearchResult
getAttributes
getName
- Unsupported methods:
setAttributes
toString
8. NamingEnumeration
compared to javax.naming.NamingEnumeration
NamingEnumeration
compared to javax.naming.NamingEnumeration
- Constructors: Not to be instantiated by the user
- Supported methods: Uses same input arguments as
javax.naming.NamingEnumeration
hasMore
next
- Unsupported methods:
close
Updated about 2 years ago