You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by RBC Bankster <rb...@gmail.com> on 2011/03/22 19:16:57 UTC

Wicket Auth-Roles and Spring Security 3

Hi,

I'm using Wicket 1.4 with Auth Roles and Spring Security 3.  My application
is split into two parts: a web application in Wicket and a service
application, and they are deployed as separate WAR files.  Wicket talks to
the service application using web services and servlets.

The servlet calls require that the HTTP cookie gets passed through correctly
in order to maintain the Spring Security context.  However, the cookie list
in the Wicket application is empty.

Cookie[] cookies =
((WebRequest)RequestCycle.get().getRequest()).getCookies();

The "cookies" array is empty.

I can see the JSESSIONID cookie in Tomcat by turning on the RequestDumper
valve so I know the value is there, I just don't know why it isn't available
to Wicket.

Any ideas why my cookies are missing?

David.

Re: Wicket Auth-Roles and Spring Security 3

Posted by James Carman <ja...@carmanconsulting.com>.
Have you ever done this in a non-wicket environment?  I would get that
working first before you try to introduce Wicket to the mix.

On Tue, Mar 22, 2011 at 2:52 PM, RBC Bankster <rb...@gmail.com> wrote:
> JSESSIONID
>
> On Tue, Mar 22, 2011 at 2:49 PM, James Carman <ja...@carmanconsulting.com>
> wrote:
>>
>> What cookies are you expecting to be there?  What cookies does your
>> services layer expect?
>>
>> On Tue, Mar 22, 2011 at 2:47 PM, RBC Bankster <rb...@gmail.com>
>> wrote:
>> > The simplest way is talking to the servlet in the services application.
>> > This
>> > is done using a PostMethod and HttpClient.
>> >
>> > i.e.
>> > PostMethod filePost = new PostMethod("http://...");
>> > filePost.setRequestHeader("Cookie", StringUtils.join(cookies));
>> > HttpClient client = new HttpClient();
>> > client.executeMethod(filePost);
>> >
>> > Except that the cookies are empty.
>> >
>> > On Tue, Mar 22, 2011 at 2:36 PM, James Carman
>> > <ja...@carmanconsulting.com>wrote:
>> >
>> >> How are you "talking to" your services?
>> >>
>> >> On Tue, Mar 22, 2011 at 2:16 PM, RBC Bankster <rb...@gmail.com>
>> >> wrote:
>> >> > Hi,
>> >> >
>> >> > I'm using Wicket 1.4 with Auth Roles and Spring Security 3.  My
>> >> application
>> >> > is split into two parts: a web application in Wicket and a service
>> >> > application, and they are deployed as separate WAR files.  Wicket
>> >> > talks
>> >> to
>> >> > the service application using web services and servlets.
>> >> >
>> >> > The servlet calls require that the HTTP cookie gets passed through
>> >> correctly
>> >> > in order to maintain the Spring Security context.  However, the
>> >> > cookie
>> >> list
>> >> > in the Wicket application is empty.
>> >> >
>> >> > Cookie[] cookies =
>> >> > ((WebRequest)RequestCycle.get().getRequest()).getCookies();
>> >> >
>> >> > The "cookies" array is empty.
>> >> >
>> >> > I can see the JSESSIONID cookie in Tomcat by turning on the
>> >> > RequestDumper
>> >> > valve so I know the value is there, I just don't know why it isn't
>> >> available
>> >> > to Wicket.
>> >> >
>> >> > Any ideas why my cookies are missing?
>> >> >
>> >> > David.
>> >> >
>> >>
>> >
>
>

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


Re: Wicket Auth-Roles and Spring Security 3

Posted by RBC Bankster <rb...@gmail.com>.
JSESSIONID

On Tue, Mar 22, 2011 at 2:49 PM, James Carman <ja...@carmanconsulting.com>wrote:

> What cookies are you expecting to be there?  What cookies does your
> services layer expect?
>
> On Tue, Mar 22, 2011 at 2:47 PM, RBC Bankster <rb...@gmail.com>
> wrote:
> > The simplest way is talking to the servlet in the services application.
> This
> > is done using a PostMethod and HttpClient.
> >
> > i.e.
> > PostMethod filePost = new PostMethod("http://...");
> > filePost.setRequestHeader("Cookie", StringUtils.join(cookies));
> > HttpClient client = new HttpClient();
> > client.executeMethod(filePost);
> >
> > Except that the cookies are empty.
> >
> > On Tue, Mar 22, 2011 at 2:36 PM, James Carman <
> james@carmanconsulting.com>wrote:
> >
> >> How are you "talking to" your services?
> >>
> >> On Tue, Mar 22, 2011 at 2:16 PM, RBC Bankster <rb...@gmail.com>
> >> wrote:
> >> > Hi,
> >> >
> >> > I'm using Wicket 1.4 with Auth Roles and Spring Security 3.  My
> >> application
> >> > is split into two parts: a web application in Wicket and a service
> >> > application, and they are deployed as separate WAR files.  Wicket
> talks
> >> to
> >> > the service application using web services and servlets.
> >> >
> >> > The servlet calls require that the HTTP cookie gets passed through
> >> correctly
> >> > in order to maintain the Spring Security context.  However, the cookie
> >> list
> >> > in the Wicket application is empty.
> >> >
> >> > Cookie[] cookies =
> >> > ((WebRequest)RequestCycle.get().getRequest()).getCookies();
> >> >
> >> > The "cookies" array is empty.
> >> >
> >> > I can see the JSESSIONID cookie in Tomcat by turning on the
> RequestDumper
> >> > valve so I know the value is there, I just don't know why it isn't
> >> available
> >> > to Wicket.
> >> >
> >> > Any ideas why my cookies are missing?
> >> >
> >> > David.
> >> >
> >>
> >
>

Re: Wicket Auth-Roles and Spring Security 3

Posted by James Carman <ja...@carmanconsulting.com>.
What cookies are you expecting to be there?  What cookies does your
services layer expect?

On Tue, Mar 22, 2011 at 2:47 PM, RBC Bankster <rb...@gmail.com> wrote:
> The simplest way is talking to the servlet in the services application. This
> is done using a PostMethod and HttpClient.
>
> i.e.
> PostMethod filePost = new PostMethod("http://...");
> filePost.setRequestHeader("Cookie", StringUtils.join(cookies));
> HttpClient client = new HttpClient();
> client.executeMethod(filePost);
>
> Except that the cookies are empty.
>
> On Tue, Mar 22, 2011 at 2:36 PM, James Carman <ja...@carmanconsulting.com>wrote:
>
>> How are you "talking to" your services?
>>
>> On Tue, Mar 22, 2011 at 2:16 PM, RBC Bankster <rb...@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > I'm using Wicket 1.4 with Auth Roles and Spring Security 3.  My
>> application
>> > is split into two parts: a web application in Wicket and a service
>> > application, and they are deployed as separate WAR files.  Wicket talks
>> to
>> > the service application using web services and servlets.
>> >
>> > The servlet calls require that the HTTP cookie gets passed through
>> correctly
>> > in order to maintain the Spring Security context.  However, the cookie
>> list
>> > in the Wicket application is empty.
>> >
>> > Cookie[] cookies =
>> > ((WebRequest)RequestCycle.get().getRequest()).getCookies();
>> >
>> > The "cookies" array is empty.
>> >
>> > I can see the JSESSIONID cookie in Tomcat by turning on the RequestDumper
>> > valve so I know the value is there, I just don't know why it isn't
>> available
>> > to Wicket.
>> >
>> > Any ideas why my cookies are missing?
>> >
>> > David.
>> >
>>
>

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


Re: Wicket Auth-Roles and Spring Security 3

Posted by RBC Bankster <rb...@gmail.com>.
The simplest way is talking to the servlet in the services application. This
is done using a PostMethod and HttpClient.

i.e.
PostMethod filePost = new PostMethod("http://...");
filePost.setRequestHeader("Cookie", StringUtils.join(cookies));
HttpClient client = new HttpClient();
client.executeMethod(filePost);

Except that the cookies are empty.

On Tue, Mar 22, 2011 at 2:36 PM, James Carman <ja...@carmanconsulting.com>wrote:

> How are you "talking to" your services?
>
> On Tue, Mar 22, 2011 at 2:16 PM, RBC Bankster <rb...@gmail.com>
> wrote:
> > Hi,
> >
> > I'm using Wicket 1.4 with Auth Roles and Spring Security 3.  My
> application
> > is split into two parts: a web application in Wicket and a service
> > application, and they are deployed as separate WAR files.  Wicket talks
> to
> > the service application using web services and servlets.
> >
> > The servlet calls require that the HTTP cookie gets passed through
> correctly
> > in order to maintain the Spring Security context.  However, the cookie
> list
> > in the Wicket application is empty.
> >
> > Cookie[] cookies =
> > ((WebRequest)RequestCycle.get().getRequest()).getCookies();
> >
> > The "cookies" array is empty.
> >
> > I can see the JSESSIONID cookie in Tomcat by turning on the RequestDumper
> > valve so I know the value is there, I just don't know why it isn't
> available
> > to Wicket.
> >
> > Any ideas why my cookies are missing?
> >
> > David.
> >
>

Re: Wicket Auth-Roles and Spring Security 3

Posted by James Carman <ja...@carmanconsulting.com>.
How are you "talking to" your services?

On Tue, Mar 22, 2011 at 2:16 PM, RBC Bankster <rb...@gmail.com> wrote:
> Hi,
>
> I'm using Wicket 1.4 with Auth Roles and Spring Security 3.  My application
> is split into two parts: a web application in Wicket and a service
> application, and they are deployed as separate WAR files.  Wicket talks to
> the service application using web services and servlets.
>
> The servlet calls require that the HTTP cookie gets passed through correctly
> in order to maintain the Spring Security context.  However, the cookie list
> in the Wicket application is empty.
>
> Cookie[] cookies =
> ((WebRequest)RequestCycle.get().getRequest()).getCookies();
>
> The "cookies" array is empty.
>
> I can see the JSESSIONID cookie in Tomcat by turning on the RequestDumper
> valve so I know the value is there, I just don't know why it isn't available
> to Wicket.
>
> Any ideas why my cookies are missing?
>
> David.
>

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