You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by ll...@oreillyauto.com on 2012/04/13 15:17:17 UTC
Additional problems with login form
By working with a developer and looking at tomcat logs I was able to figure
out my first problem - our application expect certain cookies to be
present/sent even if an empty string and jmeter by default does not send
those types of cookies.
However, now that I have adjusted the properties for that I have ran into
another problem.
I am now getting a authentication.exception.DigitalSignatureFailedException
when I try to login.
What is the best way to try to correct this? I was really wanting these
tests to be as blackbox as possible, though that is seeming less likely as
time goes on.
I do see a signature cookie in the set of cookies being received and sent,
but it would seem it is wrong somehow.
I don't know for sure (yet) how this is generated
Thank you.
Lee Lowder
This communication and any attachments are confidential, protected by Communications Privacy Act 18 USCS � 2510, solely for the use of the intended recipient, and may contain legally privileged material. If you are not the intended recipient, please return or destroy it immediately. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org
Re: Additional problems with login form
Posted by Deepak Shetty <sh...@gmail.com>.
>using a BeanShell PRE processor, and not a POST?
sorry , yes that should be a pre processor. One of the objects available to
pre processor is the sampler object (a java object whose javadoc wa
provided in the previous mail.)
I cannot test or provide a working snippet till later - heres pseudo code
import org.apache.jmeter.protocol.http.control.Cookie;
*Cookie cookie = new Cookie(*"name of your cookie"
<http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html>,
vars.get("RegexVariableNameThatyouextractedto"),
"domainforcookie"
<http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html>,
"pathforcookie"
<http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html>,
false,
reallylargelongvalueforexpiry*);
*
sampler.getCookieManager().add(cookie);
You probbaly got bean shell errors that should be logged in jmeter.log - so
check that if something fails
regards
deepak
On Wed, Apr 18, 2012 at 1:34 PM, <ll...@oreillyauto.com> wrote:
> Deepak Shetty <sh...@gmail.com> wrote on 04/18/2012 01:49:16 PM:
> >
> > Extracting the cookie is a regex extractor (where you select the option
> for
> > Header) and extract based on the name or 'Set-Cookie' header
> > Then you add a beanshell post processor that does something like
> > sampler.getCookieManager().addCookie(cookie); where the cookie is based
> on
> > the value you extracted
>
> I seem to be doing something wrong. I am able to extract the section of the
> cookie I need, in the format I need.
>
> However, the cookie is not showing up as I need/want it to.
>
> In the example given is "sampler" the literal text I would use, or is it a
> placeholder for the actual sampler or some other sort of reference to the
> sampler the processor is attached to?
>
> Also, I am needing to modify the cookies being SENT, so shouldn't I be
> using a BeanShell PRE processor, and not a POST?
>
> Reference Name : GROUP_COOKIE
> Regular Expression : tn_cookie_groups=("[A-Za-z0-9\ _-]*")
> Template : $1$
>
> Script:
>
> sampler.getCookieManager().addCookie(Cookie("tn_cookie_groups2", $
> {GROUP_COOKIE}));
>
> I have also tried:
>
> sampler.getCookieManager().addCookie("tn_cookie_groups2", $
> {GROUP_COOKIE});
>
> in both pre and post processors.
>
> Please forgive me if this is something obvious or basic, but I am
> relatively new to jmeter and have been fighting with this issue for
> approaching two weeks now.
>
> Thank you for your help.
>
> Lee Lowder
>
> This communication and any attachments are confidential, protected by
> Communications Privacy Act 18 USCS § 2510, solely for the use of the
> intended recipient, and may contain legally privileged material. If you are
> not the intended recipient, please return or destroy it immediately. Thank
> you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>
Re: Additional problems with login form
Posted by ll...@oreillyauto.com.
Deepak Shetty <sh...@gmail.com> wrote on 04/18/2012 01:49:16 PM:
>
> Extracting the cookie is a regex extractor (where you select the option
for
> Header) and extract based on the name or 'Set-Cookie' header
> Then you add a beanshell post processor that does something like
> sampler.getCookieManager().addCookie(cookie); where the cookie is based
on
> the value you extracted
I seem to be doing something wrong. I am able to extract the section of the
cookie I need, in the format I need.
However, the cookie is not showing up as I need/want it to.
In the example given is "sampler" the literal text I would use, or is it a
placeholder for the actual sampler or some other sort of reference to the
sampler the processor is attached to?
Also, I am needing to modify the cookies being SENT, so shouldn't I be
using a BeanShell PRE processor, and not a POST?
Reference Name : GROUP_COOKIE
Regular Expression : tn_cookie_groups=("[A-Za-z0-9\ _-]*")
Template : $1$
Script:
sampler.getCookieManager().addCookie(Cookie("tn_cookie_groups2", $
{GROUP_COOKIE}));
I have also tried:
sampler.getCookieManager().addCookie("tn_cookie_groups2", $
{GROUP_COOKIE});
in both pre and post processors.
Please forgive me if this is something obvious or basic, but I am
relatively new to jmeter and have been fighting with this issue for
approaching two weeks now.
Thank you for your help.
Lee Lowder
This communication and any attachments are confidential, protected by Communications Privacy Act 18 USCS � 2510, solely for the use of the intended recipient, and may contain legally privileged material. If you are not the intended recipient, please return or destroy it immediately. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org
Re: Additional problems with login form
Posted by Deepak Shetty <sh...@gmail.com>.
Extracting the cookie is a regex extractor (where you select the option for
Header) and extract based on the name or 'Set-Cookie' header
Then you add a beanshell post processor that does something like
sampler.getCookieManager().addCookie(cookie); where the cookie is based on
the value you extracted
http://jmeter.apache.org/api/org/apache/jmeter/protocol/http/sampler/HTTPSampler.html
regards
deepak
On Wed, Apr 18, 2012 at 11:37 AM, <ll...@oreillyauto.com> wrote:
> Shmuel Krakower <sh...@gmail.com> wrote on 04/18/2012 12:32:28 PM:
>
> > I had something like that once, couldn't find any of the cookie policies
> to
> > work for me.
> > I've worked around it by putting a regex extractor to get the cookies the
> > way I need them and just put it in the http headers, as any other header.
>
> I am having trouble getting this work properly. Can you please provide an
> example, or some additional information?
>
> Thank you.
>
>
> Lee Lowder
>
> This communication and any attachments are confidential, protected by
> Communications Privacy Act 18 USCS § 2510, solely for the use of the
> intended recipient, and may contain legally privileged material. If you are
> not the intended recipient, please return or destroy it immediately. Thank
> you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>
Re: Additional problems with login form
Posted by ll...@oreillyauto.com.
Shmuel Krakower <sh...@gmail.com> wrote on 04/18/2012 12:32:28 PM:
> I had something like that once, couldn't find any of the cookie policies
to
> work for me.
> I've worked around it by putting a regex extractor to get the cookies the
> way I need them and just put it in the http headers, as any other header.
I am having trouble getting this work properly. Can you please provide an
example, or some additional information?
Thank you.
Lee Lowder
This communication and any attachments are confidential, protected by Communications Privacy Act 18 USCS � 2510, solely for the use of the intended recipient, and may contain legally privileged material. If you are not the intended recipient, please return or destroy it immediately. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org
Re: Additional problems with login form
Posted by Shmuel Krakower <sh...@gmail.com>.
I had something like that once, couldn't find any of the cookie policies to
work for me.
I've worked around it by putting a regex extractor to get the cookies the
way I need them and just put it in the http headers, as any other header.
Shmuel.
On Wed, Apr 18, 2012 at 4:53 PM, <ll...@oreillyauto.com> wrote:
> Additional research has shown me that httpclient is stripping the quotes
> from the cookie value, and this is causing the cookie parser on the server
> to truncate the cookie value.
>
> I know it is possible to create custom cookie policies for use with
> httpclient, but is there an easy way to make that show up in jmeter?
>
> By easy, I mean via config or property file, or even via plugin. I'd prefer
> not to have to rebuild it.
>
> Thank you.
>
> Lee Lowder
>
> This communication and any attachments are confidential, protected by
> Communications Privacy Act 18 USCS § 2510, solely for the use of the
> intended recipient, and may contain legally privileged material. If you are
> not the intended recipient, please return or destroy it immediately. Thank
> you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>
Re: Additional problems with login form
Posted by ll...@oreillyauto.com.
Additional research has shown me that httpclient is stripping the quotes
from the cookie value, and this is causing the cookie parser on the server
to truncate the cookie value.
I know it is possible to create custom cookie policies for use with
httpclient, but is there an easy way to make that show up in jmeter?
By easy, I mean via config or property file, or even via plugin. I'd prefer
not to have to rebuild it.
Thank you.
Lee Lowder
This communication and any attachments are confidential, protected by Communications Privacy Act 18 USCS � 2510, solely for the use of the intended recipient, and may contain legally privileged material. If you are not the intended recipient, please return or destroy it immediately. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org
Re: Additional problems with login form
Posted by ll...@oreillyauto.com.
Deepak Shetty <sh...@gmail.com> wrote on 04/13/2012 02:44:16 PM:
> >Even though I can see the full data in the View Result Tree listener, on
> the sever side it cuts off after the space.
> One option is try the different Cookie Manager options (Cookie Policy)
and
> see if any of them work for you
I have used every cookie manager,and I get the same results. I tried using
a different user and was able to find one without any spaces in any of the
groups, and I was able to login successfully.
One of the developers here is looking through the sources to see if there
is a hidden property somewhere we can set, like the one for enabling null
cookies. If not, he will create one and we will submit it as a patch once
we have it working.
If I am able to discover, or create a solution, I will let y'all know as
well, just to increase that body of knowledge.
>
> otherwise Looks like you will have to look at this at a binary level. You
> can either use something like wireshark (or a proxy like fiddler and
route
> the browser and Jmeter through it) and see what is the exact binary being
> sent in the headers(i.e. what character is being sent as space, whether
the
> rest is being sent or not and whats the difference as compared to the
> browser. its possible there is a bug in Jmeter in which case you would
need
> to raise a bugzilla.
>
>
This communication and any attachments are confidential, protected by Communications Privacy Act 18 USCS � 2510, solely for the use of the intended recipient, and may contain legally privileged material. If you are not the intended recipient, please return or destroy it immediately. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org
Re: Additional problems with login form
Posted by Deepak Shetty <sh...@gmail.com>.
>Even though I can see the full data in the View Result Tree listener, on
the sever side it cuts off after the space.
One option is try the different Cookie Manager options (Cookie Policy) and
see if any of them work for you
otherwise Looks like you will have to look at this at a binary level. You
can either use something like wireshark (or a proxy like fiddler and route
the browser and Jmeter through it) and see what is the exact binary being
sent in the headers(i.e. what character is being sent as space, whether the
rest is being sent or not and whats the difference as compared to the
browser. its possible there is a bug in Jmeter in which case you would need
to raise a bugzilla.
On Fri, Apr 13, 2012 at 11:47 AM, <ll...@oreillyauto.com> wrote:
> Deepak Shetty <sh...@gmail.com> wrote on 04/13/2012 12:29:20 PM:
>
> > From: Deepak Shetty <sh...@gmail.com>
> > To: JMeter Users List <us...@jmeter.apache.org>
> > Date: 04/13/2012 12:36 PM
> > Subject: Re: Additional problems with login form
> >
> > Hi
> > a. So if the signature is failing , then either the signature itself is
> > wrong or the data that is being signed is wrong. You have to do a request
> > by request comparison
>
> It turns out that the data being signed is wrong. I turned up my logging
> levels on the server and was able to see what actual cookies were being
> used to generate the signature.
>
> One of the cookies used has a space in it and this seems to be the cause of
> the problem. Even though I can see the full data in the View Result Tree
> listener, on the sever side it cuts off after the space. This, of course,
> causes the signature to be wrong.
>
> So my next step is to determine how to make jmeter include the data after
> the space in the cookie it sends to the server.
>
> > b. is the signature value always the same as you seem to imply? i.e. if I
> > repeat the operation twice in the browser do i get the same value or
> > different value. its possible that there is a timestamp or something that
> > changes dynamically that you havent extracted out correctly in jmeter
> (and
> > are merely using the recorded value)
>
> I was less than clear on this part, so please forgive me. There is a
> timestamp that changes, but this timestamp is established at the start of
> the session and does not change on a per session basis.
>
> The signature will be different for each session, but for a given session
> will be the same for each request within that session.
>
> As it turns out, it is breaking due to how jmeter is currently handing
> spaces in the cookie data
>
>
> > c. Any javascripted data/cookie
> > I think you have to
> > 1. See if you have any dynamically changing or javascripted data
> > 2. Do a request by request comparison of browser v/s jmeter
> >
> > regards
> > deepak
> >
> >
>
> This communication and any attachments are confidential, protected by
> Communications Privacy Act 18 USCS § 2510, solely for the use of the
> intended recipient, and may contain legally privileged material. If you are
> not the intended recipient, please return or destroy it immediately. Thank
> you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>
Re: Additional problems with login form
Posted by ll...@oreillyauto.com.
Deepak Shetty <sh...@gmail.com> wrote on 04/13/2012 12:29:20 PM:
> From: Deepak Shetty <sh...@gmail.com>
> To: JMeter Users List <us...@jmeter.apache.org>
> Date: 04/13/2012 12:36 PM
> Subject: Re: Additional problems with login form
>
> Hi
> a. So if the signature is failing , then either the signature itself is
> wrong or the data that is being signed is wrong. You have to do a request
> by request comparison
It turns out that the data being signed is wrong. I turned up my logging
levels on the server and was able to see what actual cookies were being
used to generate the signature.
One of the cookies used has a space in it and this seems to be the cause of
the problem. Even though I can see the full data in the View Result Tree
listener, on the sever side it cuts off after the space. This, of course,
causes the signature to be wrong.
So my next step is to determine how to make jmeter include the data after
the space in the cookie it sends to the server.
> b. is the signature value always the same as you seem to imply? i.e. if I
> repeat the operation twice in the browser do i get the same value or
> different value. its possible that there is a timestamp or something that
> changes dynamically that you havent extracted out correctly in jmeter
(and
> are merely using the recorded value)
I was less than clear on this part, so please forgive me. There is a
timestamp that changes, but this timestamp is established at the start of
the session and does not change on a per session basis.
The signature will be different for each session, but for a given session
will be the same for each request within that session.
As it turns out, it is breaking due to how jmeter is currently handing
spaces in the cookie data
> c. Any javascripted data/cookie
> I think you have to
> 1. See if you have any dynamically changing or javascripted data
> 2. Do a request by request comparison of browser v/s jmeter
>
> regards
> deepak
>
>
This communication and any attachments are confidential, protected by Communications Privacy Act 18 USCS � 2510, solely for the use of the intended recipient, and may contain legally privileged material. If you are not the intended recipient, please return or destroy it immediately. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org
Re: Additional problems with login form
Posted by Deepak Shetty <sh...@gmail.com>.
Hi
a. So if the signature is failing , then either the signature itself is
wrong or the data that is being signed is wrong. You have to do a request
by request comparison
b. is the signature value always the same as you seem to imply? i.e. if I
repeat the operation twice in the browser do i get the same value or
different value. its possible that there is a timestamp or something that
changes dynamically that you havent extracted out correctly in jmeter (and
are merely using the recorded value)
c. Any javascripted data/cookie
I think you have to
1. See if you have any dynamically changing or javascripted data
2. Do a request by request comparison of browser v/s jmeter
regards
deepak
On Fri, Apr 13, 2012 at 7:06 AM, <ll...@oreillyauto.com> wrote:
> llowder@oreillyauto.com wrote on 04/13/2012 08:17:17 AM:
>
> >
> > I am now getting a
> authentication.exception.DigitalSignatureFailedException
> > when I try to login.
> >
> > What is the best way to try to correct this? I was really wanting these
> > tests to be as blackbox as possible, though that is seeming less likely
> as
> > time goes on.
> >
> > I do see a signature cookie in the set of cookies being received and
> sent,
> > but it would seem it is wrong somehow.
> >
> > I don't know for sure (yet) how this is generated
>
> Just wanted to follow up, the signature is a salted hash of the other
> cookie data.
>
> Jmeter is sending the same set of cookie as the browser, so something else
> is being changed.
>
> From talking to one of the developers, there are no other tokens or
> anything used.
>
> Any help or suggestions is much appreciated.
>
> Thank you.
> Lee Lowder
>
> This communication and any attachments are confidential, protected by
> Communications Privacy Act 18 USCS § 2510, solely for the use of the
> intended recipient, and may contain legally privileged material. If you are
> not the intended recipient, please return or destroy it immediately. Thank
> you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>
Re: Additional problems with login form
Posted by ll...@oreillyauto.com.
llowder@oreillyauto.com wrote on 04/13/2012 08:17:17 AM:
>
> I am now getting a
authentication.exception.DigitalSignatureFailedException
> when I try to login.
>
> What is the best way to try to correct this? I was really wanting these
> tests to be as blackbox as possible, though that is seeming less likely
as
> time goes on.
>
> I do see a signature cookie in the set of cookies being received and
sent,
> but it would seem it is wrong somehow.
>
> I don't know for sure (yet) how this is generated
Just wanted to follow up, the signature is a salted hash of the other
cookie data.
Jmeter is sending the same set of cookie as the browser, so something else
is being changed.
>From talking to one of the developers, there are no other tokens or
anything used.
Any help or suggestions is much appreciated.
Thank you.
Lee Lowder
This communication and any attachments are confidential, protected by Communications Privacy Act 18 USCS � 2510, solely for the use of the intended recipient, and may contain legally privileged material. If you are not the intended recipient, please return or destroy it immediately. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org