1 Reply Latest reply on May 8, 2013 9:42 PM by Bond Chan

    SecurityAssociation.getSubject() returns null

    siva chakilam Newbie

      we are trying to upgrade to Jboss 5.1 from 4.2 version.

       

      While reading the subject we are using "SecurityAssociation.getSubject()", this used to work for us in Jboss 4.2.

       

      But in Jboss 5.1 domain th method is returning null.

       

      I have tried with other below mentioned available options, but all of them are returning null:

       

      SecurityContext securityContext = SecurityContextAssociation.getSecurityContext();

      Subject subject2 = securityContext.getUtil().getSubject();

       

       

      subject3 = (Subject)PolicyContext.getContext(

      "javax.security.auth.Subject.container");

       

      Please let us know what is the correct API to read the subject in context.