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.Logger
logger
protected int
mType
-
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 void
addPassword(java.lang.String prompt, java.lang.String pw)
Add password to private password data structure.int
getAuthType()
get authentication type.java.lang.String
getBindDN()
java.lang.String
getBindPassword()
java.lang.String
getClientCertNickname()
java.lang.String
getPasswordFromStore(java.lang.String prompt)
IPasswordStore
getPasswordStore()
void
init(IConfigStore config)
initialize this class from the config store.void
init(IConfigStore config, java.lang.String host, int port, boolean secure)
initialize this class from the config store, and verify the password.void
removePassword(java.lang.String prompt)
Remove password from private password data structure.void
reset()
Reset the connection to the hostvoid
setPasswordStore(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:
init
in 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:
init
in 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:ILdapAuthInfo
Reset the connection to the host- Specified by:
reset
in interfaceILdapAuthInfo
-
getAuthType
public int getAuthType()
get authentication type.- Specified by:
getAuthType
in 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:ILdapAuthInfo
Add password to private password data structure.- Specified by:
addPassword
in interfaceILdapAuthInfo
- Parameters:
prompt
- Password prompt.pw
- Password itself.
-
removePassword
public void removePassword(java.lang.String prompt)
Description copied from interface:ILdapAuthInfo
Remove password from private password data structure.- Specified by:
removePassword
in interfaceILdapAuthInfo
- Parameters:
prompt
- Identify password to remove with prompt.
-
-