Package com.netscape.cmscore.ldapconn
Class LdapAuthInfo
- java.lang.Object
-
- com.netscape.cmscore.ldapconn.LdapAuthInfo
-
public class LdapAuthInfo extends java.lang.Objectclass for reading ldap authentication info from config store
-
-
Field Summary
Fields Modifier and Type Field Description static intLDAP_AUTHTYPE_BASICAUTHstatic intLDAP_AUTHTYPE_NONEstatic intLDAP_AUTHTYPE_SSLCLIENTAUTHstatic java.lang.StringLDAP_BASICAUTH_STRstatic java.lang.StringLDAP_SSLCLIENTAUTH_STRstatic org.slf4j.Loggerloggerprotected intmTypestatic java.lang.StringPROP_BINDDNstatic java.lang.StringPROP_BINDDN_DEFAULTstatic java.lang.StringPROP_BINDPWstatic java.lang.StringPROP_BINDPW_PROMPTstatic java.lang.StringPROP_CLIENTCERTNICKNAMEstatic java.lang.StringPROP_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(LDAPAuthenticationConfig config)initialize this class from the config store.voidinit(LDAPAuthenticationConfig 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()voidsetPasswordStore(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.
-
-