Date: 2005-02-15T17:31:41
Editor: BrianLee
Wiki: Jakarta-Slide Wiki
Page: WebDavConstructionKit
URL: http://wiki.apache.org/jakarta-slide/WebDavConstructionKit
no comment
Change Log:
------------------------------------------------------------------------------
@@ -78,13 +78,10 @@
'''1.getAuthenticationSession (2x one with user/password one with user
only):''' asks if a certain user exists and authenticated itself correctly and
if so an object that allows access to your system, i.e. a session or connection
or anything similiar, is passed back; in case the user has already
authenticated correctly before only the user with no password is passed
-Here is an example:
+Here is a very simple example:
{{{
public Object getAuthenticationSession(String loginId, String password)
{
- String cansasSession = null;
- fakeMap.put(loginId, cansasSession);
-
/*
* make calls to your user database with your custom Data Access
Object class and return the userid
*/
@@ -92,7 +89,7 @@
UserBean userBean = userDAO.getUser(loginId);
/* ensures that the given password matches what is stored in the
database */
- if (userBean == null || !StringUtil.isEqual(password,
userBean.getPassword()))
+ if (userBean == null || password.trim() !=
userBean.getPassword().trim())
{
/*failed authentication*/
return null;
@@ -100,10 +97,8 @@
else
{
/*ex brian:123456*/
- cansasSession = userBean.getUserId() + StringUtil.COLON +
userBean.getPassword();
+ return userBean.getUserId() + StringUtil.COLON +
userBean.getPassword();
}
-
- return cansasSession;
}
}}}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]