5 Replies Latest reply on Mar 12, 2003 2:00 PM by John Fortin

    What I need to do to use my custom principal? Please. It´s n

    Jose Luiz Newbie

      What I need to do to use my custom principal?

      My commit() code:
      public boolean commit() throws LoginException
      Set principals = this.subject.getPrincipals();

      Group roleGroup = new SimpleGroup("Roles");
      roleGroup.addMember(new SimplePrincipal("usuario"));
      roleGroup.addMember(new SimplePrincipal("fornecedor"));

      Group callerPrincipalGroup = new SimpleGroup("CallerPrincipal");
      Principal prin = new MyCustonPrincipal(this.id, this.login);
      Principal prin = new callerPrincipalGroup.addMember(prin);

      this.login = null;
      this.senha = null;

      return true;

      I did some System.out to make sure it was running ok ... AND IT DID!

      So... I did a Servlet, code:
      public class TestPrincipal extends HttpServlet
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
      Principal p = request.getUserPrincipal();

      The browser shows:

      What am I doing wrong?

      Above my login-config.xml:
      <application-policy name="PILoginModule">

      <login-module code="mypackage.MyLoginModule" flag="required"/>

      My jboss-web.xml
      Please! Help-me!