3 Replies Latest reply on Jul 3, 2007 8:11 PM by Sol Kindle

    Authentication with more parameter than username and passwor

    Johannes Jacob Newbie

      I try to implement an application which get more information from login page to get the roles from authentificated user.

      The login page looks like that:

      <form action="j_security_check" method="POST">
       Username: <input type="text" name="j_username" />
       Password: <input type="password" name="j_password" />
       Organisation: <input type="text" name="j_organisation" /><br />
       <input type="submit" value="Login" />

      The loginmodul works fine if i try to get only the username and password from the callbackhandle.
      If i try to get the 'TextInputCallback' an UnsupportedCallbackException occur.

      sourcecode (loginmodule - during method login()):
      Callback[] theCallbacks = new Callback[] {
       new NameCallback("Username: "),
       new PasswordCallback("Password: ", false),
       new TextInputCallback("Organisation: ") };
      try {
       username = ((NameCallback)callbacks[0]).getName();
       char[] tmpPassword = ((PasswordCallback)callbacks[1]).getPassword();
       strOrganisationId = ((TextInputCallback)callbacks[2]).getText(); // here is the problem...
      }catch (....)
      } ...

      I think this must be often use. Has anybody an idea or a method of solution.

      Thx J.M.Jacob