0 Replies Latest reply on Feb 27, 2012 1:08 PM by Flemming Harms

    What is the expected behavior for a bean with @RunAsPrincipal

    Flemming Harms Novice

      I have question regarding @RunAsPrincipal for version JBoss AS 5.1 and how it should work.


      We have a quartz scheduler running, which 1.) create an InitialContext based on the specified SECURITY_PRINCIPAL and SECURITY_CREDENTIALS. 2.) lookup the bean through JNDI and invoke the specified method. The bean it lookup is annotated with @SecurityDomain and  @RunAsPrincipal, but it doesn't respect the @RunAsPrincipal annotation. The principal is still the one created with the InitialContext.


      So fare I work around it, by allowing the developer to set the user name and password in the InitialContext,  but it seems odd it doesn't respect my @RunAsPrincipal.


      Is this expected behavior for bean with @RunAsPrincipal and InitialContext?