users@glassfish.java.net

Replacement for principal name "ANONYMOUS"

From: <forums_at_java.net>
Date: Tue, 26 Jul 2011 05:25:48 -0500 (CDT)

One of our MDBs invokes a SB. That SB is using
getCallerPrincipal().getName(). That always returns "ANONYMOUS". How can we
replace that with another user name? We provided @RunAs("System") to the MDB
and mapped a single principal in glassfish-application.xml:

<security-role-mapping> <role-name>System</role-name>
<principal-name>Foo</principal-name> </security-role-mapping>
Unfortunately this has no effect, we still get "ANONYMOUS". Also, we provided
a Default Principal and Default Principal Password in the adming GUI, with
neither effect.

What is the correct and working way to tell GFv3.1.1_b11 that each time
@RunAs("System") is used, getCallerPrincipal().getName() shall return "Foo"
but not "ANONYOUS"?


--
[Message sent by forum member 'mkarg']
View Post: http://forums.java.net/node/826153