0 Replies Latest reply on Aug 12, 2013 4:16 AM by Michael Schwarz

    Client application to get the roles of a logged in user (JAAS)

    Michael Schwarz Newbie

      Hi there,

       

      I have the following code working to run a client java application to login a user on the jboss server running with jaas authentication.

       

      JaasJbossConfiguration.activateConfiguration();

      UsernamePasswordHandler handler = new UsernamePasswordHandler("userName", "passWord");

      LoginContext lc = new LoginContext("myrealm", handler);

      try {

           lc.login();

      } catch (LoginException e) {

           // Authentication failed.

      }

       

       

      Now I wonder how to test if this user is in a specific role or better how to get all roles. I'd like to do this from client side.