com.netscape.cms.authentication
Class PortalEnroll

java.lang.Object
  extended by com.netscape.cms.authentication.DirBasedAuthentication
      extended by com.netscape.cms.authentication.PortalEnroll
All Implemented Interfaces:
IAuthManager, IExtendedPluginInfo

public class PortalEnroll
extends DirBasedAuthentication

uid/pwd directory based authentication manager

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $

Field Summary
static java.lang.String CRED_PWD
           
static java.lang.String CRED_UID
           
protected static java.lang.String[] mConfigParams
           
protected static java.lang.String[] mRequiredCreds
           
protected static java.lang.String PROP_AUTHTYPE
           
protected static java.lang.String PROP_BINDDN
           
protected static java.lang.String PROP_BINDPW
           
protected static java.lang.String PROP_HOST
           
protected static java.lang.String PROP_LDAPAUTH
           
protected static java.lang.String PROP_LDAPCONN
           
protected static java.lang.String PROP_OBJECTCLASS
           
protected static java.lang.String PROP_PORT
           
protected static java.lang.String PROP_SECURECONN
           
protected static java.lang.String PROP_VERSION
           
 
Fields inherited from class com.netscape.cms.authentication.DirBasedAuthentication
DEFAULT_DNPATTERN, mConfig, mConnFactory, mExtendedPluginInfo, mImplName, mLdapAttrs, mLdapByteAttrs, mLdapConfig, mLdapStringAttrs, mLogger, mName, mPattern, PROP_BASEDN, PROP_DNPATTERN, PROP_LDAP, PROP_LDAPBYTEATTRS, PROP_LDAPSTRINGATTRS, USER_DN
 
Fields inherited from interface com.netscape.certsrv.authentication.IAuthManager
CRED_CERT_SERIAL_TO_REVOKE, CRED_HOST_NAME, CRED_SESSION_ID, CRED_SSL_CLIENT_CERT
 
Fields inherited from interface com.netscape.certsrv.base.IExtendedPluginInfo
HELP_TEXT, HELP_TOKEN
 
Constructor Summary
PortalEnroll()
          Default constructor, initialization must follow.
 
Method Summary
protected  java.lang.String authenticate(netscape.ldap.LDAPConnection conn, IAuthCredentials authCreds, AuthToken token)
          Authenticates a user based on uid, pwd in the directory.
 java.lang.String[] getConfigParams()
          Returns a list of configuration parameter names.
 java.lang.String[] getExtendedPluginInfo(java.util.Locale locale)
          This method returns an array of strings.
 java.lang.String[] getRequiredCreds()
          Returns array of required credentials for this authentication manager.
 void init(java.lang.String name, java.lang.String implName, IConfigStore config)
          Initializes the PortalEnrollment auth manager.
 void initLdapAttrs(netscape.ldap.LDAPSchema dirSchema, java.lang.String oclass)
           
 java.lang.String regist(AuthToken token, java.lang.String uid)
          adds a user to the directory.
 
Methods inherited from class com.netscape.cms.authentication.DirBasedAuthentication
authenticate, formCertInfo, formSubjectName, getConfigStore, getImplName, getLdapAttrs, getLdapByteAttrs, getName, init, log, setAuthTokenByteValue, setAuthTokenStringValue, setAuthTokenValues, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_LDAPAUTH

protected static final java.lang.String PROP_LDAPAUTH
See Also:
Constant Field Values

PROP_AUTHTYPE

protected static final java.lang.String PROP_AUTHTYPE
See Also:
Constant Field Values

PROP_BINDDN

protected static final java.lang.String PROP_BINDDN
See Also:
Constant Field Values

PROP_BINDPW

protected static final java.lang.String PROP_BINDPW
See Also:
Constant Field Values

PROP_LDAPCONN

protected static final java.lang.String PROP_LDAPCONN
See Also:
Constant Field Values

PROP_HOST

protected static final java.lang.String PROP_HOST
See Also:
Constant Field Values

PROP_PORT

protected static final java.lang.String PROP_PORT
See Also:
Constant Field Values

PROP_SECURECONN

protected static final java.lang.String PROP_SECURECONN
See Also:
Constant Field Values

PROP_VERSION

protected static final java.lang.String PROP_VERSION
See Also:
Constant Field Values

PROP_OBJECTCLASS

protected static final java.lang.String PROP_OBJECTCLASS
See Also:
Constant Field Values

CRED_UID

public static final java.lang.String CRED_UID
See Also:
Constant Field Values

CRED_PWD

public static final java.lang.String CRED_PWD
See Also:
Constant Field Values

mRequiredCreds

protected static java.lang.String[] mRequiredCreds

mConfigParams

protected static java.lang.String[] mConfigParams
Constructor Detail

PortalEnroll

public PortalEnroll()
             throws EBaseException
Default constructor, initialization must follow.

Throws:
EBaseException
Method Detail

init

public void init(java.lang.String name,
                 java.lang.String implName,
                 IConfigStore config)
          throws EBaseException
Initializes the PortalEnrollment auth manager.

Specified by:
init in interface IAuthManager
Overrides:
init in class DirBasedAuthentication
Parameters:
name - - The name for this authentication manager instance.
implName - - The name of the authentication manager plugin.
config - - The configuration store for this instance.
Throws:
EBaseException - If an error occurs during initialization.

authenticate

protected java.lang.String authenticate(netscape.ldap.LDAPConnection conn,
                                        IAuthCredentials authCreds,
                                        AuthToken token)
                                 throws EBaseException
Authenticates a user based on uid, pwd in the directory.

Specified by:
authenticate in class DirBasedAuthentication
Parameters:
authCreds - The authentication credentials.
Returns:
The user's ldap entry dn.
Throws:
EInvalidCredentials - If the uid and password are not valid
EBaseException - If an internal error occurs.

getConfigParams

public java.lang.String[] getConfigParams()
Returns a list of configuration parameter names. The list is passed to the configuration console so instances of this implementation can be configured through the console.

Specified by:
getConfigParams in interface IAuthManager
Specified by:
getConfigParams in class DirBasedAuthentication
Returns:
String array of configuration parameter names.

getExtendedPluginInfo

public java.lang.String[] getExtendedPluginInfo(java.util.Locale locale)
Description copied from interface: IExtendedPluginInfo
This method returns an array of strings. Each element of the array represents a configurable parameter, or some other meta-info (such as help-token) there is an entry indexed on that parameter name ;[,required];;... Where: type_info is either 'string', 'number', 'boolean', 'password' or 'choice(ch1,ch2,ch3,...)' If the marker 'required' is included after the type_info, the parameter will has some visually distinctive marking in the UI. 'description' is a short sentence describing the parameter 'choice' is rendered as a drop-down list. The first parameter in the list will be activated by default 'boolean' is rendered as a checkbox. The resulting parameter will be either 'true' or 'false' 'string' allows any characters 'number' allows only numbers 'password' is rendered as a password field (the characters are replaced with *'s when being types. This parameter is not passed through to the plugin. It is instead inserted directly into the password cache keyed on the instance name. The value of the parameter 'bindPWPrompt' (see example below) is set to the key. In addition to the configurable parameters, the following magic parameters may be defined: HELP_TOKEN;helptoken - a pointer to the online manual section for this plugin HELP_TEXT;helptext - a general help string describing the plugin For example: "username;string;The username you wish to login as" "bindPWPrompt;password;Enter password to bind as above user with" "algorithm;choice(RSA,DSA);Which algorithm do you want to use" "enable;boolean;Do you want to run this plugin" "port;number;Which port number do you want to use"

Specified by:
getExtendedPluginInfo in interface IExtendedPluginInfo
Overrides:
getExtendedPluginInfo in class DirBasedAuthentication

getRequiredCreds

public java.lang.String[] getRequiredCreds()
Returns array of required credentials for this authentication manager.

Specified by:
getRequiredCreds in interface IAuthManager
Specified by:
getRequiredCreds in class DirBasedAuthentication
Returns:
Array of required credentials.

regist

public java.lang.String regist(AuthToken token,
                               java.lang.String uid)
adds a user to the directory.

Parameters:
token - authentication token
uid - the user's id.
Returns:
dn upon success and null upon failure.

initLdapAttrs

public void initLdapAttrs(netscape.ldap.LDAPSchema dirSchema,
                          java.lang.String oclass)