Sounds like the confirmed string is null. String confirmed = data.getUser().getConfirmed(); if (confirmed == null || !confirmed.equals(JetspeedResources.CONFIRM_VALUE )) { if ( confirmed.equals(JetspeedResources.CONFIRM_VALUE_REJECTED)) <==================
I will add a patch in a minute: if ( confirmed != null && confirmed.equals(JetspeedResources.CONFIRM_VALUE_REJECTED)) > -----Original Message----- > From: Werner Ramaekers [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 29, 2002 11:10 AM > To: [EMAIL PROTECTED] > Subject: Custom Security Authentication > > > Hey, > > i'm trying to create my own custom Authentication class because i need > to Authenticate the user's password against a hardware token Controller. > This means i need to verify the password presented by the users which > was generated by his token against the Controller for whic i know the API. > > I'm having trouble to get a simple custom testAuthentication > class running : > I've written a > public class CustomAuthentication extends TurbineBaseService implements > PortalAuthentication { > > and implemented a simple login method : > > public JetspeedUser login(String username, String password) throws > LoginException { > JetspeedUser user = null; > //see if we can make this work using a very basic > username/password test > if ("test".equals(username) && "test".equals(password)) { > System.out.println("username/pw are OK"); > user = new BaseJetspeedUser(); > System.out.println("user created"); > user.setUserName(username); > System.out.println("username set"); > // Mark the user as being logged in. > user.setHasLoggedIn(new Boolean(true)); > System.out.println("login_date set"); > // Set the last_login date in the database. > try { > //user.updateLastLogin(); > putUserIntoContext(user); > System.out.println("user in context"); > if (cachingEnable) { > System.out.println("trying to load cache"); > JetspeedSecurityCache.load(username); > System.out.println("cache loaded"); > } > } > catch (Exception e) { > System.out.println("exception occured"); > putUserIntoContext(JetspeedSecurity.getAnonymousUser()); > throw new LoginException("Failed to update last login > ", e); > } > } else { > throw new LoginException("username/password combination not > known to me !"); > } > > when the user logs in i get a > Horrible Exception: java.lang.NullPointerException at > org.apache.jetspeed.modules.actions.JLoginUser.doPerform(JLoginUse > r.java:305) > at org.apache.turbine.modules.ActionEvent.perform(ActionEvent.java:148) > at org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122) > at org.apache.turbine.Turbine.doGet(Turbine.java:456) at > org.apache.turbine.Turbine.doPost(Turbine.java:616) at > javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at > > so i'm puzzled to say the least : > can anyone tell me what i'm supposed to do to make my own Authentication > class work ? How to create the JetspeedUser ? > What needs to be implemented ? > > thanks for your time ;-) > > Werner > > > -- > ---------------------------------------------------------------------- > ir. Werner Ramaekers > Enterprise Java Solutions Architect - Shift@ > Sun Certified Java Programmer > > "May the source be with you." > <mailto:[EMAIL PROTECTED]> <http://www.shiftat.com> > ---------------------------------------------------------------------- > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>