can you have a try in an EJB please? (just try to add @Stateless on your
managed bean for instance)

can you share a sample easy to run?

- Romain


2012/6/1 José Luis Cetina <[email protected]>

> Yes, im using JAAS
>
> 2012/5/31 Romain Manni-Bucau <[email protected]>
>
> > Hi,
> >
> > Do you use jaas?
> >
> > - Romain
> > Le 31 mai 2012 20:14, "José Luis Cetina" <[email protected]> a écrit
> :
> >
> > > Hi i have this scenario:
> > >
> > > I have a page login.xhtml, this page has a ManagedBean (@Named) this
> > > managedbean use the request.login(user,pass) method.
> > >
> > > When i do this:
> > >
> > > managedbean class:
> > >
> > > @Resource
> > > private EJBContext ejbContext;
> > > .
> > > .
> > > request.login(user,pass);
> > > String name = ejbContext.getCallerPrincipal().getName();
> > >
> > > I get "guest" as my user name. But i expect the name of my user (of
> > course
> > > is not guest)
> > >
> > > If the login was successful my login page navigate to other page lets
> say
> > > pageb.xhtml
> > >
> > > If i create a managedbean (@Named) for pageb.xhtml and in that
> > managedbean
> > > i use again:
> > > String name = ejbContext.getCallerPrincipal().getName();
> > > then, here i get my "correct" name of the user (not guest).
> > >
> > > I dont know if this is the desire behaviour or if this happend because
> > the
> > > http request isnt finished?
> > >
> > > other question why if i call
> > > the  ejbContext.getCallerPrincipal().getName(); before the
> > request.login()
> > > method i get again "guest", why not null?
> > >
> > > If this question is for tomee(openejb) or tomcat?
> > >
> > > Thanks
> > >
> > >
> > > -------------------------------------------------------------------
> > > *SCJA. José Luis Cetina*
> > > -------------------------------------------------------------------
> > >
> >
>
>
>
> --
> -------------------------------------------------------------------
> *SCJA. José Luis Cetina*
> -------------------------------------------------------------------
>

Reply via email to