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

      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.