Package com.netscape.cmscore.ldapconn
Class LdapAuthInfo
- java.lang.Object
-
- com.netscape.cmscore.ldapconn.LdapAuthInfo
-
public class LdapAuthInfo extends java.lang.Object
class for reading ldap authentication info from config store
-
-
Field Summary
Fields Modifier and Type Field Description static int
LDAP_AUTHTYPE_BASICAUTH
static int
LDAP_AUTHTYPE_NONE
static int
LDAP_AUTHTYPE_SSLCLIENTAUTH
static java.lang.String
LDAP_BASICAUTH_STR
static java.lang.String
LDAP_SSLCLIENTAUTH_STR
static org.slf4j.Logger
logger
protected int
mType
static java.lang.String
PROP_BINDDN
static java.lang.String
PROP_BINDDN_DEFAULT
static java.lang.String
PROP_BINDPW
static java.lang.String
PROP_BINDPW_PROMPT
static java.lang.String
PROP_CLIENTCERTNICKNAME
static java.lang.String
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(LDAPAuthenticationConfig config)
initialize this class from the config store.void
init(LDAPAuthenticationConfig 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()
void
setPasswordStore(IPasswordStore passwordStore)
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
PROP_LDAPAUTHTYPE
public static final java.lang.String PROP_LDAPAUTHTYPE
- See Also:
- Constant Field Values
-
PROP_CLIENTCERTNICKNAME
public static final java.lang.String PROP_CLIENTCERTNICKNAME
- See Also:
- Constant Field Values
-
PROP_BINDDN
public static final java.lang.String PROP_BINDDN
- See Also:
- Constant Field Values
-
PROP_BINDPW
public static final java.lang.String PROP_BINDPW
- See Also:
- Constant Field Values
-
PROP_BINDPW_PROMPT
public static final java.lang.String PROP_BINDPW_PROMPT
- See Also:
- Constant Field Values
-
PROP_BINDDN_DEFAULT
public static final java.lang.String PROP_BINDDN_DEFAULT
- See Also:
- Constant Field Values
-
LDAP_BASICAUTH_STR
public static final java.lang.String LDAP_BASICAUTH_STR
- See Also:
- Constant Field Values
-
LDAP_SSLCLIENTAUTH_STR
public static final java.lang.String LDAP_SSLCLIENTAUTH_STR
- See Also:
- Constant Field Values
-
LDAP_AUTHTYPE_NONE
public static final int LDAP_AUTHTYPE_NONE
- See Also:
- Constant Field Values
-
LDAP_AUTHTYPE_BASICAUTH
public static final int LDAP_AUTHTYPE_BASICAUTH
- See Also:
- Constant Field Values
-
LDAP_AUTHTYPE_SSLCLIENTAUTH
public static final int LDAP_AUTHTYPE_SSLCLIENTAUTH
- See Also:
- Constant Field Values
-
mType
protected int mType
-
-
Method Detail
-
getPasswordFromStore
public java.lang.String getPasswordFromStore(java.lang.String prompt) throws EBaseException
- Throws:
EBaseException
-
init
public void init(LDAPAuthenticationConfig config) throws EBaseException
initialize this class from the config store.- Throws:
EBaseException
-
init
public void init(LDAPAuthenticationConfig config, java.lang.String host, int port, boolean secure) throws EBaseException
initialize this class from the config store, and verify the password.- 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.- Throws:
EBaseException
-
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()
-
getAuthType
public int getAuthType()
get authentication type.- 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)
Add password to private password data structure.- Parameters:
prompt
- Password prompt.pw
- Password itself.
-
removePassword
public void removePassword(java.lang.String prompt)
Remove password from private password data structure.- Parameters:
prompt
- Identify password to remove with prompt.
-
-