The spec also says: <ejb-2.0 spec> 21.3.4.1 Run-as The Application Assembler can use the run-as element to define a run-as identity for an enterprise
bean in the deployment descriptor. The run-as identity applies to the enterprise bean as a whole, that is, to all methods of the enterprise bean's home and component interfaces or to the onMessage method of a message-driven bean, and all internal methods of the bean that they might in turn call. Establishing a run-as identity for an enterprise bean does not affect the identities of its callers, which are the identities tested for permission to access the methods of the enterprise bean. The run-as identity establishes the identity the enterprise bean will use when it makes calls. Because the Application Assembler does not, in general, know the security environment of the operational environment, the run-as identity is designated by a logical role-name, which corresponds to one of the security roles defined by the Application Assembler in the deployment descriptor. The Deployer then assigns a security principal defined in the operational environment to be used as the principal for the run-as identity. The security principal assigned by the Deployer should be a principal that has been assigned to the security role specified by the role-name element. </ejb-2.0 spec> The getCallerPrincipal of the bean with the run-as will return the caller of the bean, not the run-as identity. Which contextual use of getCallerPrincipal are you talking about? xxxxxxxxxxxxxxxxxxxxxxxx Scott Stark Chief Technology Officer JBoss Group, LLC xxxxxxxxxxxxxxxxxxxxxxxx ----- Original Message ----- From: "Alex Loubyansky" <[EMAIL PROTECTED]> To: "JBoss-User" <[EMAIL PROTECTED]> Sent: Tuesday, May 07, 2002 9:54 AM Subject: [JBoss-user] getCallerPrincipal() and run-as > It was discussed many times but could someone explain it once more, > please. > > The EJB2.0 spec says: > "The Application Assembler should specify the requirements for the caller�s principal management of > enterprise bean invocations by means of the security-identity deployment descriptor element > and as part of the description. If use-caller-identity is specified as the value of the security- > identity element, the caller principal is propagated from the caller to the callee. (That is, the > called enterprise bean will see the same returned value of the EJBContext.getCallerPrincipal() > as the calling enterprise bean.) If the run-as element is specified, a security principal that has > been assigned to the specified security role will be used for the execution of the bean�s methods and will > be visible as the caller principal in the callee." > > Does "will be visible as the caller principal in the callee" mean that > it will be returned as a result of getCallerPrincipal()? As it is > implemented in jboss, the answer is no. > > So, what's the difference between getCallerPrincipal() and "will be visible as the caller > principal in the callee"? > > TIA > > -- > Best regards, > Alex mailto:[EMAIL PROTECTED] > > > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
