I've done this (not sure if this is the thread u were referring to).
See http://www.objectweb.org/messages/JonasUsers/2000/11/msg00087.html
It sounds like you have not ensured that the server-side version of
jonathan.prop is in the server's classpath. It is worth noting that,
JEREMIE_jonas.jar contains a jonathan.prop that doesn't have any properties
in it! So if you don't ensure that the correct jonathan.prop is *before*
JEREMIE_jonas.jar in the classpath, Jonas will use the empty jonathan.prop,
and things won't work.
This is so important that I have written a little class to test it. My
script that starts the server runs this class first, which traces out the
number of properties in the first jonathan.prop in the classpath. If it
traces out zero, I can see immediately that my classpath is incorrect. It's
attached.
Also note that John Ellis has solved the problem of fat client
authentication much more elegantly and correctly with his own JNDI
implementation - it's too late for me to use it unfortunately... :(
Joe
Bill Skrypnyk wrote:
> I have seen a thread on the mailing list on how to set principal in a
> context from a stand-alone
> client. I followed the instructions, but I still get Jonas_client as the
> principal on the server side.
>
> EJBServer trace shows that my roles are initialized properly. I am at
> my wit's ends. Can
> anyone see the problem?
>
> My setup follows:
> -------------------
>
> I am using Jeremie.
>
> 1. My jonas-users.properties:
>
> hello = vas
>
> 2. In my client I do:
>
> public class SecClient {
>
> public static void main( String args[] ) {
>
> SecurityContext ctx = new SecurityContext ("hello");
> SecurityCurrent current = SecurityCurrent.getCurrent () ;
> current.setSecurityContext(ctx) ;
>
> try {
> Context initial = null;
> initial = new InitialContext();
> Object objref = initial.lookup("aka/security/Pitbull");
> if( objref == null )
> System.out.println( "Got null reference" );
> else
> System.out.println( "Got reference" );
>
> PitbullHome home =
> (PitbullHome)PortableRemoteObject.narrow(objref,
> PitbullHome.class);
> Pitbull pitbull = home.create();
> pitbull.testPrincipal();
>
> etc...
>
> 3. In my ejb-jar.xml I have:<ejb-jar>
> <description>AKA EJB Application</description>
> <display-name>AKA EJB App</display-name>
> <enterprise-beans>
>
> <session>
> <description>
> This is an Pitbull bean
> </description>
> <ejb-name>aka/security/Pitbull</ejb-name>
> <home>com.electricmail.security.PitbullHome</home>
> <remote>com.electricmail.security.Pitbull</remote>
> <ejb-class>com.electricmail.security.PitbullBean</ejb-class>
> <session-type>Stateless</session-type>
> <transaction-type>Container</transaction-type>
> <security-role-ref>
> <role-name>vas</role-name>
> <role-link>vas</role-link>
> </security-role-ref>
> </session>
> </enterprise-beans>
>
> <assembly-descriptor>
>
> <security-role>
> <description>
> Just a trial
> </description>
> <role-name>vas</role-name>
> </security-role>
>
> <method-permission>
> <role-name>vas</role-name>
> <method>
> <ejb-name>aka/security/Pitbull</ejb-name>
> <method-name>*</method-name>
> </method>
> </method-permission>
>
> </assembly-descriptor>
>
> </ejb-jar>
>
> ----
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "unsubscribe jonas-users".
> For general help, send email to [EMAIL PROTECTED] and
> include in the body of the message "help".
JonathanDotPropTest.java