1 Reply Latest reply on Jul 10, 2008 12:22 PM by kgoedert

    question about custom login module and principal

    kgoedert

      Hello,

      I'm creating a custom login module and principal based on the references of jboss wiki. When a client tries to access my beans I use the following:

       env.setProperty(Context.SECURITY_PRINCIPAL, "user");
       env.setProperty(Context.SECURITY_CREDENTIALS, "pass");
       env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.JndiLoginInitialContextFactory");
       Context context = new InitialContext(env);
       ISayHello talk = (ISayHello) context.lookup("myapp/ejb/SayBean");
      
       System.out.println(talk.sayHello());
      


      And it works fine. But, I would like to have something that allows the user to inform if he would like to log as an administrator or as a regular user. Is it possible? How could I do that?

      Thanks

      Kelly