|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.nidp.authentication.local.LocalAuthenticationClass
public abstract class LocalAuthenticationClass
Provides methods for authenticating to the local authority. It is an abstract class, so that each local authentication class can be implemented as a subclass.
Field Summary | |
---|---|
static int |
AUTHENTICATED
Indicates that the authentication was successful. |
static int |
CANCEL
Indicates that the authentication was cancelled. |
static int |
HANDLED_REQUEST
Indicates that the request was handled and that a query for more information is necessary for the authentication to proceed. |
protected java.util.Properties |
m_Properties
The class and method properties defined in the admin utility as well as other system properties. |
protected HttpServletRequest |
m_Request
The current HttpServletRequest that is being processed. |
protected HttpServletResponse |
m_Response
The HttpServletResponse that will be responded to. |
protected NIDPSession |
m_Session
The current Novell Identity Server session. |
static int |
NOT_AUTHENTICATED
Indicates that the authentication was unsuccessful. |
static int |
PWD_EXPIRED
Indicates that the user's password is expired. |
static int |
PWD_EXPIRING
Indicates that the user's password is expiring. |
Constructor Summary | |
---|---|
LocalAuthenticationClass(java.util.Properties props,
java.util.ArrayList uStores)
Defines the constructor to be used by all classes to do local authentication. |
Method Summary | |
---|---|
protected void |
addCredential(WSCQToken token,
XMLBase value)
Adds a credential used to authencicate. |
protected void |
addLDAPCredentials()
Adds the LDAP credentials, except the password. |
protected void |
addPrincipalAttributes(java.lang.String strAttr,
java.lang.String[] values)
Sets attributes for a user that has been authenticated. |
int |
authenticate()
Performs the authentication process. |
protected boolean |
authenticateWithPassword(java.lang.String userid,
java.lang.String password)
Authenticates a user after locating the user with the specified DN. |
protected boolean |
authenticateWithQuery(java.lang.String query,
java.lang.String password)
Authenticates a user after locating the user with an LDAP query. |
java.util.ArrayList |
clearCredentials()
|
protected int |
doAuthenticate()
This is essentially an abstract method designed to be overloaded by authentication classes that intend to take advantage of secret store unlocking. |
protected java.lang.String |
escapeName(java.lang.String name)
Escapes the characters typed by the user. |
protected NIDPPrincipal[] |
findPrincipals(java.lang.String userid)
Searches through a list of user stores for users that match the specified user name. |
protected NIDPPrincipal[] |
findPrincipalsByQuery(java.lang.String filter)
Searches through a list of user stores for users that match the given query. |
protected AuthnRequest |
getAuthnRequest()
Gets the request that might have cause this authentication class to be invoked. |
protected boolean |
getBooleanProperty(java.lang.String property,
boolean deflt)
Gets a boolean value from the specified property. |
java.util.ArrayList |
getCredentials()
Gets the list of credentials used to authenticate the user. |
protected DisplayableProvider[] |
getIDPProviders()
Gets a list of identity providers that can be used as possible authentication sources. |
java.lang.String |
getLogMsg()
Gets the message for the associated error ID. |
NIDPPrincipal |
getPrincipal()
Gets the user authenticated by this class. |
protected javax.naming.directory.Attributes |
getPrincipalAttributes(java.lang.String[] attrs)
Gets the attributes for the user that has been authenticated. |
protected UserAuthority |
getPrincipalUserAuthority()
Gets the LDAP server that identified the user, assuming that m_Principal has been set. |
protected java.lang.String |
getProperty(java.lang.String property)
Returns the value of the specified property. |
protected java.lang.String |
getProvisionURL()
Gets the URL to call to provision a user. |
protected java.lang.String |
getReturnURL()
Returns the URL which any user interactions should post data to. |
java.lang.String |
getType()
Gets the authentication type this class implements. |
protected UserAuthority |
getUserAuthority(int index)
Returns the specified LDAP server. |
protected int |
getUserAuthorityCount()
Gets the number of searchable LDAP servers. |
protected java.lang.String |
getUserErrorMsg()
Gets the error message that will be displayed to the end user. |
void |
initializeRequest(HttpServletRequest request,
HttpServletResponse response,
NIDPSession session,
boolean following,
java.lang.String url)
Initializes the authentication class with the current request or response. |
protected boolean |
isCancelAppropriate()
Determines if the option to cancel the authentication is appropriate for this instance. |
protected boolean |
isDefinesUser()
Determines if this authentication class instance needs to identify a user. |
boolean |
isFailure()
Indicates whether or not this authentication failed. |
protected boolean |
isFirstCallAfterPrevMethod()
Determines if this authentication class begins execution immediately after the successful completion of another class. |
protected boolean |
isFirstInstance()
Determines if this authentication class instance is the first since the system started up or was reconfigured. |
protected boolean |
isPendingAuthnRequest()
Determines if there is a pending authentication request that has come from a service provider. |
protected boolean |
isUserIdentification()
Determines if this authentication class instance is the result of an assertion being returned to an unauthenticated session. |
boolean |
mustPersist()
Indicates if this class must persist during interaction with the user. |
protected void |
setErrorMsg(java.lang.String userErr,
java.lang.String logErr)
Sets the error message to send to the end user and to the log file. |
protected void |
setErrorMsg(java.lang.String userErr,
java.lang.String logErr,
java.lang.String logParam)
Sets the error message to send to the end user and to the log file as well as a parameter to send with the log file message. |
protected void |
setFailure()
Sets a failure state for the current authentication. |
protected void |
setPrincipal(NIDPPrincipal principal)
Sets the user to be authenticated by this class. |
protected void |
setPrincipalAttributes(java.lang.String[] attrs,
java.lang.String[] values)
Sets the attributes for a user that has been authenticated. |
protected void |
setUserErrorMsg(java.lang.String userMsg)
Sets the error message to be displayed to an end user. |
protected void |
showErrorJSP(java.lang.String msg)
Causes an error JSP to be executed to display an error message. |
protected void |
showJSP(java.lang.String jsp)
Forwards execution to a specific JSP. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int AUTHENTICATED
authenicate
,
Constant Field Valuespublic static final int HANDLED_REQUEST
authenicate
,
Constant Field Valuespublic static final int NOT_AUTHENTICATED
authenticate
,
Constant Field Valuespublic static final int CANCEL
authenticate
,
Constant Field Valuespublic static final int PWD_EXPIRING
authenitcate
,
Constant Field Valuespublic static final int PWD_EXPIRED
authenticate
,
Constant Field Valuesprotected java.util.Properties m_Properties
protected HttpServletRequest m_Request
initializeRequest
protected HttpServletResponse m_Response
initializeRequest
protected NIDPSession m_Session
Constructor Detail |
---|
public LocalAuthenticationClass(java.util.Properties props, java.util.ArrayList uStores)
props
- The properties associated with the implementing class.uStores
- A list of ordered user stores to authenticate against.Method Detail |
---|
public void initializeRequest(HttpServletRequest request, HttpServletResponse response, NIDPSession session, boolean following, java.lang.String url)
request
- The HttpServletRequest that the request came in on.response
- The HttpServletResponse that the request will respond with.session
- The user's liberty session.following
- True if this class is following a previous method, otherwise false.url
- The URL to return to after completion of context.public java.lang.String getType()
public NIDPPrincipal getPrincipal()
protected void setPrincipal(NIDPPrincipal principal)
principal
- The user to be considered authenticated.public boolean isFailure()
protected void setFailure()
protected java.lang.String getProvisionURL()
protected java.lang.String getReturnURL()
public boolean mustPersist()
protected boolean isFirstInstance()
protected boolean isCancelAppropriate()
protected boolean isDefinesUser()
protected boolean isUserIdentification()
protected boolean isFirstCallAfterPrevMethod()
protected boolean isPendingAuthnRequest()
protected AuthnRequest getAuthnRequest()
protected DisplayableProvider[] getIDPProviders()
protected void showErrorJSP(java.lang.String msg)
msg
- The error message that is to be displayed.protected void showJSP(java.lang.String jsp)
jsp
- Specifies the JSP to which control should be forwarded.protected void setErrorMsg(java.lang.String userErr, java.lang.String logErr)
userErr
- The message to be displayed to the end user.logErr
- The message to log for the administrator.protected void setErrorMsg(java.lang.String userErr, java.lang.String logErr, java.lang.String logParam)
userErr
- The message to be displayed to the end user.logErr
- The message to log for the administrator.logParam
- The parameter to be used as part of the log file error message.protected void setUserErrorMsg(java.lang.String userMsg)
userMsg
- The message to display to the end user on an error page.protected java.lang.String getUserErrorMsg()
public java.lang.String getLogMsg()
protected void addLDAPCredentials()
protected void addCredential(WSCQToken token, XMLBase value)
token
- The credential token used.value
- The credential value.public java.util.ArrayList getCredentials()
public java.util.ArrayList clearCredentials()
protected java.lang.String escapeName(java.lang.String name)
name
- The user name.
protected int getUserAuthorityCount()
getUserAuthority
protected UserAuthority getUserAuthority(int index)
index
- The index of the LDAP server to return.
getUserAuthorityCount
protected UserAuthority getPrincipalUserAuthority()
getUserAuthority
,
getPrincipal
protected boolean authenticateWithPassword(java.lang.String userid, java.lang.String password) throws PasswordExpiredException, PasswordExpiringException
userid
- The DN of the user to locate in a user store.password
- The password with which to authenticate the user.
PasswordExpiredException
- An exception that occurs only with eDir, indicating the
user's password has expired.
PasswordExpiringException
- An exception that occurs only with eDir, indicating the
user's password is about to expire.protected boolean authenticateWithQuery(java.lang.String query, java.lang.String password) throws PasswordExpiredException, PasswordExpiringException
query
- The LDAP query to use to identify the user in a user store.password
- The password with which to authenticate the user.
PasswordExpiredException
- An exception that occurs only with eDir, indicating
the user's password has expired.
PasswordExpiringException
- An exception that occurs only with eDir, indicating
the user's password is about to expire.protected NIDPPrincipal[] findPrincipals(java.lang.String userid)
userid
- The ID of the user to search for.
protected NIDPPrincipal[] findPrincipalsByQuery(java.lang.String filter)
filter
- The filter or query to use.
protected javax.naming.directory.Attributes getPrincipalAttributes(java.lang.String[] attrs)
attrs
- An array of strings representing the attributes to obtain.
protected void setPrincipalAttributes(java.lang.String[] attrs, java.lang.String[] values) throws NIDPException
attrs
- An array of strings representing the attributes to set.values
- An array of value objects to associate with the attributes
in the attribute array.
NIDPException
protected void addPrincipalAttributes(java.lang.String strAttr, java.lang.String[] values) throws NIDPException
attrs
- A strings representing the attribute to set.values
- An array of value objects to associate with the attribute.
NIDPException
protected java.lang.String getProperty(java.lang.String property)
property
- The property name.
protected boolean getBooleanProperty(java.lang.String property, boolean deflt)
property
- The name of the boolean property.deflt
- The default value to return if the property is not found.
public int authenticate()
AUTHENTICATED
, NOT_AUTHENTICATED
,
CANCELLEDCANCEL
, HANDLED_REQUEST
,
PWD_EXPIRING
, OR PWD_EXPIRED
.protected int doAuthenticate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |