# Using Gatling with Websphere 7 - Authentication problems

**URL:** <https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157>\
**Category:** Gatling (Open-Source)\
**Created:** [November 2, 2012, 3:08pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157 "2012-11-02T15:08:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josselin\_Pierre](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@Josselin\_Pierre](https://community.gatling.io/u/Josselin_Pierre)\
**Post date:** [November 2, 2012, 3:08pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/1 "2012-11-02T15:08:37Z")

</div>

Hi everyone !

I discovered Gatling recently, and since I have to setup some not-that-clearly-defined performance tests for my current project, I thought I’d give it a try…  
I’m more a coder than a tester, so between Gatling-coding and JMeter-massclicking, the choice is quite simple. =D

But after one day struggling with it, I still haven’t manage to properly login on the application.  
The login itself seems to happen properly, Gatling retrieve JSESSIONID and LtpaToken2 as expected, but then Websphere acts as if the current user is not logged at all.

Has anyone already tried and succeeded in running Gatling against Websphere ?  
I’m far from being a network nor a security expert, so I probably made some newbie mistakes…

Here’s my script and execution logs (damn, can’t attach to mail !)  
[http://tsukilulu.free.fr/gatling/](http://tsukilulu.free.fr/gatling/)

And here’s my configuration :  
Gatling 1.3.4 running inside Eclipse Juno  
Websphere Application Server 7.0.0.15 - Struts2/EJB3 application, using a custom framework relying on websphere authentication.  
JDK 1.6  
Windows7 64bits  
everything running on the same computer

I’m kind of swamped here, so if anyone has any solution or advice on how to proceed to make it works,  
thanks in advance !

Josselin.

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 2, 2012, 5:51pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/2 "2012-11-02T17:51:06Z")

</div>

Hi Pierre,

Could you also print the responses (just like with requestInfoExtractor), please?  
Or even better, could you record the http traffic with a tool such as CharlesProxy or tcpmon (the one produced with Gatling, and the one with a brower)?

Cheers,

Stéphane

---

<div class="post-metadata">

**Author:** ![Josselin\_Pierre](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@Josselin\_Pierre](https://community.gatling.io/u/Josselin_Pierre)\
**Post date:** [November 2, 2012, 7:18pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/3 "2012-11-02T19:18:07Z")

</div>

Hi,

I knew I should have recorded it when I checked that…  
Anyway, I’ll send you a record of the http traffic on monday ; I unfortunately can’t access work servers from home.

Have a nice weekend and thanks in advance  
Cheers,  
Josselin

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 2, 2012, 7:53pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/4 "2012-11-02T19:53:57Z")

</div>

Thanks and you too.

---

<div class="post-metadata">

**Author:** ![Josselin\_Pierre](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@Josselin\_Pierre](https://community.gatling.io/u/Josselin_Pierre)\
**Post date:** [November 5, 2012, 7:22am UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/5 "2012-11-05T07:22:08Z")

</div>

Hi,

As promised, here are the Charles recording / improved console output  
[http://tsukilulu.free.fr/gatling/20121105/](http://tsukilulu.free.fr/gatling/20121105/)

As far as I can tell, the differences start after the call to j\_security\_check ; the headers of the following call are quite different ; but since it appears to be a redirect i’m not sure I have much control over it.  
But once again, I’m far from being a web expert, so no idea what could be the impact of such differences.

Thanks in advance for any help you could provide,

Josselin.

---

<div class="post-metadata">

**Author:** ![Nicolas\_R](https://avatars.discourse-cdn.com/v4/letter/n/f14d63/32.png) [@Nicolas\_R](https://community.gatling.io/u/Nicolas_R)\
**Post date:** [November 5, 2012, 1:00pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/6 "2012-11-05T13:00:41Z")

</div>

Hi Josselin,

Your scenario starts with :

.exec(http(“displayLoginPage”)  
.get("/emcmn-portail/LoginServlet")  
.headers(headers\_1))

If I’m correct, for an authentication, you should actually not start at the login page, so, could you change your scenario so that it starts with :

.exec(http(“Restricted access page”)  
.get("/emcmn-portail/")  
.headers(headers\_1))

Gatling should then be automatically redirected to /emcmn-portail/LoginServlet and then, you should be allowed to POST the credentials.

Is it working ?

cheers  
Nicolas

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 5, 2012, 1:03pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/7 "2012-11-05T13:03:01Z")

</div>

Hi Josselin,

First of all, note that your warm up request times out (probably because you’re behind an internet proxy):  
[https://github.com/excilys/gatling/wiki/HTTP#wiki-auto-warmup](https://github.com/excilys/gatling/wiki/HTTP#wiki-auto-warmup)

You can either disable this feature, or set up a suitable url.

Regarding the differences between your 2 Charles records, here’s what I see:

- Your Gatling simulation points to websphere **S** erver while your firefox browing point to websphereserver, not sure it matters though
- Gatling incorrectly sends a application/x-www-form-urlencoded header when redirecting. Will fix, but not sure if that’s a real problem
- Gatling’s cookies format is different  
**Gatling** :  
JSESSIONID=“0000EWscIph-lrx0uog27iDEjIn:-1”; $Path="/"; $Domain=websphereServer; LtpaToken2="+ImgCj15kKlsQU0NPkwf/As6w8Rw0jXZtoQp5rCSNKTNn5EC9hzErZpnhecPmclwjgUGGkHpS0uD9tTgCEboK/YA56JFZ+dXwegrjAx9YQJfuycheNIkfjs0049iQyseeysPOasxf2fdSb2fU1n+iAligbFzGqWYzsv8Hiz67CwEnDT/dEk1TuhK/bTdTlTSFrVJ1TFVkQtLPPPwNlY6E+7SqgViEs9bEdfTlgZTyIh1/5Mex7AiioAkP2Qz0nch5W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26R/8ObeK33MnIb+g88ZWK50U7rWM3Xn8yYjPYnZBjU2BIwjAuQTPvRR5w==

As you see, cookie values are protected with quotes, and path and domain are specified.  
I have to check what the RFC says about this.

Note that Cookies are streamed in async-http-client, not in Gatling.

Cheers,

Stéphane

---

<div class="post-metadata">

**Author:** ![Nicolas\_R](https://avatars.discourse-cdn.com/v4/letter/n/f14d63/32.png) [@Nicolas\_R](https://community.gatling.io/u/Nicolas_R)\
**Post date:** [November 5, 2012, 1:20pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/8 "2012-11-05T13:20:39Z")

</div>

Stéphane,

The more important difference is that the POST /j\_security\_check done with Firefox contains this additionnal header :

> Set-Cookie | WASReqURL=“”; Expires=Thu, 01-Dec-94 16:00:00 GMT; Path=/ |
> 
> - | - |

Even though the cookie is expired, it show us that there is already a difference.

cheers,  
Nicolas

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 5, 2012, 1:23pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/9 "2012-11-05T13:23:37Z")

</div>

Yep, I noticed that. It seems it’s a cookie for memorizing the landing page after authenticating.  
I supposed/hoped that if none was specified, the LoginServlet would simply redirect to /, but maybe you’re right and it indeed matters.

---

<div class="post-metadata">

**Author:** ![Josselin\_Pierre](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@Josselin\_Pierre](https://community.gatling.io/u/Josselin_Pierre)\
**Post date:** [November 5, 2012, 1:26pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/10 "2012-11-05T13:26:30Z")

</div>

Hi

@Nicolas Rémond

Following your advice, I’ve just tried requesting first an access-restricted page.  
The call is directly redirected to the same LoginServlet, and afterwards the scenario follows the exact same path.

@Stéphane Landelle

- Thanks for the tip for the warmup phase. I did read about this warmup in the documentation, but right now i’m not that worried about the accuracy of the performances results, so I let it be.  
I’ll disable it anyway, if only to clean-up the network captures.

- “Your Gatling simulation points to websphere **S** erver while your firefox browing point to websphereserver, not sure it matters though”  
This host is defined as “websphereServer” in my Windows’ host file, and it doesn’t appear to be case sensitive ; i’m using either one indifferently.  
I also tried specifying the IP directly ; no change whatsoever.

- As for the headers and cookies, I also noticed these differences, but I don’t know enough about http headers to sort between relevant an irrelevant differences.  
I’ll try making some time to dig into these, if only for my personal knowledge.

Unfortunately, I currently don’t have much free time, so I won’t be able to mess with Gatling source code right now.  
But if I can test things or provide you with any information that might help you improving Gatling, just ask, I’ll be happy to help out.

cheers,  
Josselin

---

<div class="post-metadata">

**Author:** ![Nicolas\_R](https://avatars.discourse-cdn.com/v4/letter/n/f14d63/32.png) [@Nicolas\_R](https://community.gatling.io/u/Nicolas_R)\
**Post date:** [November 5, 2012, 1:34pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/11 "2012-11-05T13:34:21Z")

</div>

Hi,

_@Nicolas Rémond_

_Following your advice, I’ve just tried requesting first an access-restricted page._  
_The call is directly redirected to the same LoginServlet, and afterwards the scenario follows the exact same path._

---

<div class="post-metadata">

**Author:** ![Josselin\_Pierre](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@Josselin\_Pierre](https://community.gatling.io/u/Josselin_Pierre)\
**Post date:** [November 5, 2012, 1:47pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/12 "2012-11-05T13:47:21Z")

</div>

Hi,

For reference, I’ve uploaded the Charles’ tracing of the scenario starting with an access to a secured page here:  
[http://tsukilulu.free.fr/gatling/20121105/loginRecording\_Gatling\_firstQueryAnAccessRestrictedPage.chls](http://tsukilulu.free.fr/gatling/20121105/loginRecording_Gatling_firstQueryAnAccessRestrictedPage.chls)

In this case, the response of the j\_security\_check does contain a

> Set-Cookie | WASReqURL=“”; Expires=Thu, 01-Dec-94 16:00:00 GMT; Path=/ |
> 
> - | - |

The cookies seems to be correctly used in the following queries.

cheers,  
Josselin

---

<div class="post-metadata">

**Author:** ![Josselin\_Pierre](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@Josselin\_Pierre](https://community.gatling.io/u/Josselin_Pierre)\
**Post date:** [November 12, 2012, 9:31am UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/13 "2012-11-12T09:31:53Z")

</div>

Hi !

Any news on this issue ?  
I know you’re kind of busy with the DEVOX coming soon, and just to be clear, I’m not pushing for a quick fix or anything.  
But since I’m supposed to set-up performance tests during this month and my teamleader is kind of pushing, so I could use an estimation of work to be done / possible fix date,  
just to know if I wait for a possible fix or fallback to a JMeter-based solution right away.

And if I could do/test anything for you, I’m here to help. =)

Thanks in advance,  
Josselin.

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 12, 2012, 9:57am UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/14 "2012-11-12T09:57:04Z")

</div>

Hi,

We have our talk this evening. I’ll try to find to time to have a lot today, otherwise will work on this tomorrow.

This only difference I can spot is that Gatling send cookies with a path and a domain, protected with quotes, while firefox doesn’t.

- Firefox: WASReqURL=http://:9080/emcmn-portail/; JSESSIONID=00000n9IvLxj1-o0shGZlxnFLTg:-1
- Gatling: JSESSIONID=“0000M4DJ\_ojGOSfWR3V0VZ7E\_gz:-1”; $Path="/"; $Domain=websphereServer; WASReqURL=“http://:9080/emcmn-portail/person/initCandidate.action”; $Path="/"; $Domain=websphereServer  
Cheers,

Stéphane

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 12, 2012, 11:28am UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/15 "2012-11-12T11:28:17Z")

</div>

I might have found it:  
[https://github.com/excilys/gatling/issues/816](https://github.com/excilys/gatling/issues/816)

You should get a snapshot from Cloudbees in about 20 minutes.  
[https://gatling.ci.cloudbees.com/](https://gatling.ci.cloudbees.com/)

[http://repository-gatling.forge.cloudbees.com/snapshot/com/excilys/ebi/gatling/highcharts/gatling-charts-highcharts/1.4.0-SNAPSHOT/](http://repository-gatling.forge.cloudbees.com/snapshot/com/excilys/ebi/gatling/highcharts/gatling-charts-highcharts/1.4.0-SNAPSHOT/)

Please let me know if it indeed fixes your problem.

Cheers,

Stéphane

PS: No more batteries, will come back online in a few hours hopefully.

---

<div class="post-metadata">

**Author:** ![Josselin\_Pierre](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@Josselin\_Pierre](https://community.gatling.io/u/Josselin_Pierre)\
**Post date:** [November 12, 2012, 12:52pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/16 "2012-11-12T12:52:06Z")

</div>

Hi,

Thanks for the fast replies.

I took the snapshot [gatling-charts-highcharts-1.4.0-20121112.114024-28-bundle.zip](http://repository-gatling.forge.cloudbees.com/snapshot/com/excilys/ebi/gatling/highcharts/gatling-charts-highcharts/1.4.0-SNAPSHOT/gatling-charts-highcharts-1.4.0-20121112.114024-28-bundle.zip)  
and re-run the same scenario as before. (I just removed the hostHeader() call which doesn’t compile anymore)  
And I got the same result : Websphere stills act like the calls are not authentificated and redirect to the login page. =/

Here are the Charles proxy recording and execution log :  
**[http://tsukilulu.free.fr/gatling/20121112](http://tsukilulu.free.fr/gatling/20121112)**  
Websphere’s log appears to be the same.

I’ve also tried to record a brand new scenario with gatling recorder and run it without modifying anything (except the host / proxy part, of course),  
and the same error occurs.

Do you want me to check anything else ?

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 12, 2012, 1:31pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/17 "2012-11-12T13:31:04Z")

</div>

Other differences:

- It seems that your Gatling simulation only accepts gzip and not deflate. Could you set up acceptEncodingHeader(“gzip, deflate”), please?
- Could you try disabling keep-alive? Go in gatling.conf and set http.allowPoolingConnection to false  
Hope we’ll find out…

Stéphane

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 12, 2012, 2:18pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/18 "2012-11-12T14:18:00Z")

</div>

Could you try this replacement of gatling-http, please?  
I’m at Devoxx right now and will be doing a demo in a few hours, so I don’t want to push something risky right now…

Cheers,

Stéphane

[gatling-http-1.4.0-SNAPSHOT.jar](https://community.gatling.io/uploads/short-url/9h6jDQ0c9EVCukPSyLSgiELXy8Q.jar) (447 KB)

---

<div class="post-metadata">

**Author:** ![Josselin\_Pierre](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@Josselin\_Pierre](https://community.gatling.io/u/Josselin_Pierre)\
**Post date:** [November 12, 2012, 2:18pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/19 "2012-11-12T14:18:28Z")

</div>

> It seems that your Gatling simulation only accepts gzip and not deflate. Could you set up acceptEncodingHeader(“gzip, deflate”), please?

My gatling simulation’s httpConf is :

```auto
val httpConf = httpConfig
			.baseURL("[http://localhost:9081](http://localhost:9081)")
			.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
			.acceptLanguageHeader("en-us,en;q=0.7,fr;q=0.3")
			.acceptEncodingHeader("gzip, deflate")
                        [...]

```

```auto
Did I miss anything while to configure the acceptEncodingHeader?

```

```auto

```

```auto
> Could you try disabling keep-alive? Go in gatling.conf and set http.allowPoolingConnection to false

```

```auto
I set it to false into the gatling.conf of the snapshot, (and removed the heading #)

```

```auto
and removed all the "keep-alive" from the request headers in the scenario (just to be extra-sure),

```

```auto
same result.

```

```auto

```

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [November 12, 2012, 2:50pm UTC](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157/20 "2012-11-12T14:50:00Z")

</div>

Could you try the jar?

[Next page](https://community.gatling.io/t/using-gatling-with-websphere-7-authentication-problems/157.md?page=2)
