Package com.netscape.cmscore.ldapconn
Class LdapAuthInfo
- java.lang.Object
-
- com.netscape.cmscore.ldapconn.LdapAuthInfo
-
- All Implemented Interfaces:
ILdapAuthInfo
public class LdapAuthInfo extends java.lang.Object implements ILdapAuthInfo
class for reading ldap authentication info from config store
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Loggerloggerprotected intmType-
Fields inherited from interface com.netscape.certsrv.ldap.ILdapAuthInfo
LDAP_AUTHTYPE_BASICAUTH, LDAP_AUTHTYPE_NONE, LDAP_AUTHTYPE_SSLCLIENTAUTH, LDAP_BASICAUTH_STR, LDAP_SSLCLIENTAUTH_STR, PROP_BINDDN, PROP_BINDDN_DEFAULT, PROP_BINDPW, PROP_BINDPW_PROMPT, PROP_CLIENTCERTNICKNAME, PROP_LDAPAUTHTYPE
-
-
Constructor Summary
Constructors Constructor Description LdapAuthInfo()must call init(config) after this constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPassword(java.lang.String prompt, java.lang.String pw)Add password to private password data structure.intgetAuthType()get authentication type.java.lang.StringgetBindDN()java.lang.StringgetBindPassword()java.lang.StringgetClientCertNickname()java.lang.StringgetPasswordFromStore(java.lang.String prompt)IPasswordStoregetPasswordStore()voidinit(IConfigStore config)initialize this class from the config store.voidinit(IConfigStore config, java.lang.String host, int port, boolean secure)initialize this class from the config store, and verify the password.voidremovePassword(java.lang.String prompt)Remove password from private password data structure.voidreset()Reset the connection to the hostvoidsetPasswordStore(IPasswordStore passwordStore)
-
-
-
Method Detail
-
getPasswordFromStore
public java.lang.String getPasswordFromStore(java.lang.String prompt) throws EBaseException- Throws:
EBaseException
-
init
public void init(IConfigStore config) throws EBaseException
initialize this class from the config store.- Specified by:
initin interfaceILdapAuthInfo- Parameters:
config- The config store from which to initialize.- Throws:
EBaseException- Due to failure of the initialization process.
-
init
public void init(IConfigStore config, java.lang.String host, int port, boolean secure) throws EBaseException
initialize this class from the config store, and verify the password.- Specified by:
initin interfaceILdapAuthInfo- Parameters:
host- The host that the directory server is running on. This will be used to verify the password by attempting to connect. If it isnull, the password will not be verified.port- The port that the directory server is running on.config- The config store from which to initialize.- Throws:
EBaseException- Due to failure of the initialization process.
-
getBindDN
public java.lang.String getBindDN() throws EBaseException- Throws:
EBaseException
-
getBindPassword
public java.lang.String getBindPassword() throws EBaseException- Throws:
EBaseException
-
getClientCertNickname
public java.lang.String getClientCertNickname() throws EBaseException- Throws:
EBaseException
-
reset
public void reset()
Description copied from interface:ILdapAuthInfoReset the connection to the host- Specified by:
resetin interfaceILdapAuthInfo
-
getAuthType
public int getAuthType()
get authentication type.- Specified by:
getAuthTypein interfaceILdapAuthInfo- Returns:
- one of:
LdapAuthInfo.LDAP_AUTHTYPE_BASICAUTH or LdapAuthInfo.LDAP_AUTHTYPE_SSLCLIENTAUTH
-
getPasswordStore
public IPasswordStore getPasswordStore()
-
setPasswordStore
public void setPasswordStore(IPasswordStore passwordStore)
-
addPassword
public void addPassword(java.lang.String prompt, java.lang.String pw)Description copied from interface:ILdapAuthInfoAdd password to private password data structure.- Specified by:
addPasswordin interfaceILdapAuthInfo- Parameters:
prompt- Password prompt.pw- Password itself.
-
removePassword
public void removePassword(java.lang.String prompt)
Description copied from interface:ILdapAuthInfoRemove password from private password data structure.- Specified by:
removePasswordin interfaceILdapAuthInfo- Parameters:
prompt- Identify password to remove with prompt.
-
-