Yes exactly. Maybe using SessionContext can help getting username
Le 27 août 2013 21:55, "hwaastad" <[email protected]> a écrit :

> OK,
>
> so what you are saying is to drop the jndiprovider and do more in the line
> of this: (?)
> (the qualifier is there since I'm now testing on the same application..)
>
> If this is what you meant, I guess I still need to get the principal from
> the web continer into the properties.
> Maybe setting jndi props after successfully login?
>
> br hw
>
> ---
>
>     @Produces
>     @BusinessQualifier
>     public BusinessBeanRemote getBusinessBean() {
>         try {
>                     final Context context = new InitialContext(new
> Properties(){{
>                     put(Context.INITIAL_CONTEXT_FACTORY,
> "org.apache.openejb.client.RemoteInitialContextFactory");
>                     put(Context.PROVIDER_URL,
> "http://localhost:8080/tomee/ejb";);
>                     put("java.naming.security.principal", "the-user");
>                     put("java.naming.security.credentials", "password");
>                     put("openejb.authentication.realmName",
> "SecurityRealm");
>                     put("openejb.ejbd.authenticate-with-request", "true");
>                 }});
>             return (BusinessBeanRemote) context.lookup("jndi and what have
> you");
>         } catch (NamingException ex) {
>             Logger.getLogger(EJBProducer.class.getName()).log(Level.SEVERE,
> null, ex);
>         }
>     }
>
> --
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Propagated-security-in-TomEE-tp4664850p4664860.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Reply via email to