1 Reply Latest reply on Aug 13, 2004 5:08 AM by stueccles

    How to login to web programatically with FORM based

    cboxall1

      We are using FORM based security with our application and everything is working great. We now have a requirement to automatically log a user in when they pass a URL with a user/password. There is custom code that will be used to decrypt the user/password string in the URL. The problem that I have is I cannot call the j_security_check directly as I get errors. There have been references to: response.sendRedirect(response.encodeRedirectURL("j_security_check?" +
      J_USER_NAME + "=" + userName + "&" + J_PASSWORD + "=" + password));. We are using JBoss 3.2.3.

      What is the procedure to log in a web user. I can programatically log someone in using
      LoginContext lc = null;

      UsernamePasswordHandler handler =
      new UsernamePasswordHandler(userName, password.toCharArray());
      lc = new LoginContext("client-login", handler);
      lc.login();

      But I don't know what JBoss sets up in the session for the user. When I look at all the attributes in the session I can find no attributes after a user has signed in.

      Anyone please help.