1 Reply Latest reply on Jun 29, 2004 9:34 PM by Clive Brettingham-Moore

    How to use RunAsLoginModule?

    Don Fairall Newbie

      I am attempting to write a custom LoginModule that will authenticate the user using a secured EJB. From the documentation I have read, it appears that the RunAsLoginModule should be used to set the role used during the authentication phase. Could someone provide details as to how to use the RunAsLoginModule? Any details or examples related to setting up my login module and login-config.xml would be greatly appreciated. Do I need to set up a LoginContext within my LoginModule login() method that accesses the secured EJB? Thanks.

        • 1. Re: How to use RunAsLoginModule?
          Clive Brettingham-Moore Newbie

          You don not use a seperate login context, you just stack the modules.
          Simply place the RunAs module before the other login module in the config - it sets up the runAs identity on initialisation and clears it during the commit phase. Thus the identity is active during the initialize and login phases of your other modules.

          The option names for the module are "roleName" and "principalName"; fairly self explanitory, I think.