1 Reply Latest reply on Nov 24, 2009 7:17 AM by dario novakovic

    JAAS - more data about the user

    dario novakovic Newbie

      So far I developed webapps with User object in session that holds username, full name, role name etc.

      Now I setup declarative security using LoginModule and all is well but all I have from current user is it's principal which is username only.

      What can I do if I want to get hold of more user information from DB when authentication is performed? Do i have to create my own login module?

      What is suggested way of dealing with this?


        • 1. Re: JAAS - more data about the user
          dario novakovic Newbie

          I installed custom principal in my own LoginModule which is my domain Entity, and it looks OK from the web layer.

          BUT, when i call sessionContext.getCallerPrincipal() from my session bean, I get instance of SimplePrincipal which contains username only. I expected to get my own custom principal.

          Is that expected behavior? Why don't I get the same result as from the web app? Is there anything I can do about this?

          Please help.