You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Mansour Al Akeel <ma...@gmail.com> on 2011/03/23 01:42:44 UTC

Authorization using JAAS and getting the Principal.

Hello all,

I am authenticating a user, and it's working fine through our own Jaas
module implementation. However, I am trying to get one of the Panels to
display based on the logged in user. I am not using wicket-aut yet, and
looking to do this by obtaining the Principal implementaton from the
HttpServletRequest. I am getting null when I do so.

I am trying to avoid diving into wicket specific implementation related
to auth because I am a bit on a tight dead line.

How would others deal with this issue? 
If you have a component to be displayed depending on the logged in user,
how can I get the logged in user ? 


Thank you in advance.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Authorization using JAAS and getting the Principal.

Posted by amateo <al...@gmail.com>.
Hi, I have the same problem but I'm getting the request in a different way:  

(HttpServletRequest)
PolicyContext.getContext("javax.servlet.http.HttpServletRequest")

Did you find a solution?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Authorization-using-JAAS-and-getting-the-Principal-tp3398135p3854205.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Authorization using JAAS and getting the Principal.

Posted by Mansour Al Akeel <ma...@gmail.com>.
Thank you.
Will try that.

On Thu Mar 24,2011 08:08 pm, Mansour Al Akeel wrote:
> On Tue Mar 22,2011 10:15 pm, Zilvinas Vilutis wrote:
> > https://cwiki.apache.org/WICKET/spring-security-and-wicket-auth-roles.html#SpringSecurityandWicket-auth-roles-Wicketsetup
> > and call SecureSession.get().getUser()
> > 
> > ??ilvinas Vilutis
> > 
> > Mobile:???? (+370) 652 38353
> > E-mail:???? cikasfm@gmail.com
> > 
> > 
> > 
> > On Tue, Mar 22, 2011 at 6:13 PM, Mansour Al Akeel
> > <ma...@gmail.com> wrote:
> > > Woops forgot to include the way I am getting the request.
> > >
> > > private User getLoggedInUser() {
> > > ?? ??ServletWebRequest servletWebRequest = (ServletWebRequest) RequestCycle .get().getRequest();
> > > ?? ??HttpServletRequest request = servletWebRequest.getContainerRequest();
> > > ?? ??Principal principal = request.getUserPrincipal();
> > > ?? ??User user = (User) principal;
> > > ?? ??return user;
> > > }
> > >
> > > I appreciate your help.
> > >
> > >
> > > On Tue Mar 22,2011 08:42 pm, Mansour Al Akeel wrote:
> > >> Hello all,
> > >>
> > >> I am authenticating a user, and it's working fine through our own Jaas
> > >> module implementation. However, I am trying to get one of the Panels to
> > >> display based on the logged in user. I am not using wicket-aut yet, and
> > >> looking to do this by obtaining the Principal implementaton from the
> > >> HttpServletRequest. I am getting null when I do so.
> > >>
> > >> I am trying to avoid diving into wicket specific implementation related
> > >> to auth because I am a bit on a tight dead line.
> > >>
> > >> How would others deal with this issue?
> > >> If you have a component to be displayed depending on the logged in user,
> > >> how can I get the logged in user ?
> > >>
> > >>
> > >> Thank you in advance.
> > >>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Authorization using JAAS and getting the Principal.

Posted by Mansour Al Akeel <ma...@gmail.com>.
On Tue Mar 22,2011 10:15 pm, Zilvinas Vilutis wrote:
> https://cwiki.apache.org/WICKET/spring-security-and-wicket-auth-roles.html#SpringSecurityandWicket-auth-roles-Wicketsetup
> and call SecureSession.get().getUser()
> 
> ??ilvinas Vilutis
> 
> Mobile:???? (+370) 652 38353
> E-mail:???? cikasfm@gmail.com
> 
> 
> 
> On Tue, Mar 22, 2011 at 6:13 PM, Mansour Al Akeel
> <ma...@gmail.com> wrote:
> > Woops forgot to include the way I am getting the request.
> >
> > private User getLoggedInUser() {
> > ?? ??ServletWebRequest servletWebRequest = (ServletWebRequest) RequestCycle .get().getRequest();
> > ?? ??HttpServletRequest request = servletWebRequest.getContainerRequest();
> > ?? ??Principal principal = request.getUserPrincipal();
> > ?? ??User user = (User) principal;
> > ?? ??return user;
> > }
> >
> > I appreciate your help.
> >
> >
> > On Tue Mar 22,2011 08:42 pm, Mansour Al Akeel wrote:
> >> Hello all,
> >>
> >> I am authenticating a user, and it's working fine through our own Jaas
> >> module implementation. However, I am trying to get one of the Panels to
> >> display based on the logged in user. I am not using wicket-aut yet, and
> >> looking to do this by obtaining the Principal implementaton from the
> >> HttpServletRequest. I am getting null when I do so.
> >>
> >> I am trying to avoid diving into wicket specific implementation related
> >> to auth because I am a bit on a tight dead line.
> >>
> >> How would others deal with this issue?
> >> If you have a component to be displayed depending on the logged in user,
> >> how can I get the logged in user ?
> >>
> >>
> >> Thank you in advance.
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Authorization using JAAS and getting the Principal.

Posted by Zilvinas Vilutis <ci...@gmail.com>.
https://cwiki.apache.org/WICKET/spring-security-and-wicket-auth-roles.html#SpringSecurityandWicket-auth-roles-Wicketsetup
and call SecureSession.get().getUser()

Žilvinas Vilutis

Mobile:   (+370) 652 38353
E-mail:   cikasfm@gmail.com



On Tue, Mar 22, 2011 at 6:13 PM, Mansour Al Akeel
<ma...@gmail.com> wrote:
> Woops forgot to include the way I am getting the request.
>
> private User getLoggedInUser() {
>    ServletWebRequest servletWebRequest = (ServletWebRequest) RequestCycle .get().getRequest();
>    HttpServletRequest request = servletWebRequest.getContainerRequest();
>    Principal principal = request.getUserPrincipal();
>    User user = (User) principal;
>    return user;
> }
>
> I appreciate your help.
>
>
> On Tue Mar 22,2011 08:42 pm, Mansour Al Akeel wrote:
>> Hello all,
>>
>> I am authenticating a user, and it's working fine through our own Jaas
>> module implementation. However, I am trying to get one of the Panels to
>> display based on the logged in user. I am not using wicket-aut yet, and
>> looking to do this by obtaining the Principal implementaton from the
>> HttpServletRequest. I am getting null when I do so.
>>
>> I am trying to avoid diving into wicket specific implementation related
>> to auth because I am a bit on a tight dead line.
>>
>> How would others deal with this issue?
>> If you have a component to be displayed depending on the logged in user,
>> how can I get the logged in user ?
>>
>>
>> Thank you in advance.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Authorization using JAAS and getting the Principal.

Posted by Mansour Al Akeel <ma...@gmail.com>.
Woops forgot to include the way I am getting the request.

private User getLoggedInUser() {
    ServletWebRequest servletWebRequest = (ServletWebRequest) RequestCycle .get().getRequest();
    HttpServletRequest request = servletWebRequest.getContainerRequest();
    Principal principal = request.getUserPrincipal();
    User user = (User) principal;
    return user;
}

I appreciate your help.


On Tue Mar 22,2011 08:42 pm, Mansour Al Akeel wrote:
> Hello all,
> 
> I am authenticating a user, and it's working fine through our own Jaas
> module implementation. However, I am trying to get one of the Panels to
> display based on the logged in user. I am not using wicket-aut yet, and
> looking to do this by obtaining the Principal implementaton from the
> HttpServletRequest. I am getting null when I do so.
> 
> I am trying to avoid diving into wicket specific implementation related
> to auth because I am a bit on a tight dead line.
> 
> How would others deal with this issue? 
> If you have a component to be displayed depending on the logged in user,
> how can I get the logged in user ? 
> 
> 
> Thank you in advance.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org