[undertow-dev] JSESSIONIDSSO cookie not set in response on Wildfly 9

Matt Smith matt at syple.com.au
Fri Sep 30 00:44:41 EDT 2016


Hi,

I am working on several JEE web apps that are deployed on a Wildfly 9.0.2
application server.  We have SSO enabled and working, but are having an
issue where the SSO cookie is not always returned.  Specifically, if we
restart the Wildfly instance, two of the several applications deployed on
the server stop returning the JSESSIONIDSSO cookie in their responses.  If
we disable and then re-enable those apps then they work perfectly until the
next time Wildfly is restarted.

The issue described occurs in both UAT and Production environments.  Both
environments are set up in clustered mode, with the only real difference
being that UAT has more applications deployed on it.  The Wildfly instances
also sit behind an Apache HTTPd reverse proxy using mod_proxy.  If the
servers are accessed directly - bypassing the Apache server - the problem
does not occur.  After much poking around I can only assume that the issue
is triggered by the different headers present on the proxied requests.
That's a guess though and I would really appreciate any input from people
who know Undertow much better.

All of our applications are configured the same way with regards to
security and the technology stack used.  Authentication is provided by the
server via a security domain that delegates to a security realm, and is
backed by Active Directory.  I have attached the relevant configuration
files and examples of the requests and responses.  In terms of versions, I
have reproduced the issue in Wildfly 8.0.2, 9.0.1, 9.0.2, and 10.0.1 (not
sure what Undertow versions they correspond to).

The Wildfly forum had no answers and directed me here, so I hope someone
here can help!

(PS I've changed the actual IP addresses, server names, etc in the attached
files so I don't expose the real systems - I know the IPs aren't valid, but
they are on the real system!)

Thanks,
Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20160930/b13eba05/attachment-0001.html 
-------------- next part --------------

==============================================================
2016-09-06 11:42:07,002 INFO  [io.undertow.request.dump] (default task-16) 
----------------------------REQUEST---------------------------
               URI=/app/login
 characterEncoding=null
     contentLength=41
       contentType=[application/x-www-form-urlencoded]
            header=Accept=application/json, text/plain, */*
            header=Postman-Token=cf48a071-6e88-0353-0738-2337cf89cbed
            header=Accept-Encoding=gzip, deflate
            header=X-Forwarded-Server=proxy.domain.local
            header=Origin=http://localhost:8100
            header=User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36
            header=Connection=close
            header=X-Forwarded-For=10.123.456.789
            header=Content-Type=application/x-www-form-urlencoded
            header=Content-Length=41
            header=Referer=http://localhost:8100/
            header=Host=proxy
            header=X-Forwarded-Host=proxy
            locale=[]
            method=POST
          protocol=HTTP/1.1
       queryString=
        remoteAddr=/10.321.654.987:55717
        remoteHost=srv.domain.local
            scheme=http
              host=proxy
        serverPort=8080
--------------------------RESPONSE--------------------------
     contentLength=23
       contentType=application/json
            cookie=JSESSIONID=jpYr_sVfCkwjVEt9Z2lMqCp7QMxQlR5LF6ivd23B.servername; domain=null; path=/app
            header=Connection=close
            header=X-Powered-By=Undertow/1
            header=Set-Cookie=JSESSIONID=jpYr_sVfCkwjVEt9Z2lMqCp7QMxQlR5LF6ivd23B.servername; path=/app
            header=Server=WildFly/9
            header=Content-Type=application/json
            header=Content-Length=23
            header=Date=Tue, 06 Sep 2016 01:42:07 GMT
            status=200
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jboss-web.xml
Type: text/xml
Size: 80 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/undertow-dev/attachments/20160930/b13eba05/attachment-0003.xml 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: standalone.xml
Type: text/xml
Size: 3472 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/undertow-dev/attachments/20160930/b13eba05/attachment-0004.xml 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: web.xml
Type: text/xml
Size: 1829 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/undertow-dev/attachments/20160930/b13eba05/attachment-0005.xml 
-------------- next part --------------

==============================================================
2016-09-06 11:48:05,934 INFO  [io.undertow.request.dump] (default task-56) 
----------------------------REQUEST---------------------------
               URI=/app/login
 characterEncoding=null
     contentLength=41
       contentType=[application/x-www-form-urlencoded]
            header=Accept=application/json, text/plain, */*
            header=Postman-Token=13ddd2a4-3ec8-3e5b-b322-567f69c6e39d
            header=Accept-Encoding=gzip, deflate
            header=X-Forwarded-Server=proxy.domain.local
            header=Origin=http://localhost:8100
            header=User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36
            header=Connection=close
            header=X-Forwarded-For=10.123.456.789
            header=Content-Type=application/x-www-form-urlencoded
            header=Content-Length=41
            header=Referer=http://localhost:8100/
            header=Host=proxy
            header=X-Forwarded-Host=proxy
            locale=[]
            method=POST
          protocol=HTTP/1.1
       queryString=
        remoteAddr=/10.321.654.987:55755
        remoteHost=dsrv.domain.local
            scheme=http
              host=proxy
        serverPort=8080
--------------------------RESPONSE--------------------------
     contentLength=23
       contentType=application/json
            cookie=JSESSIONID=BmEsI_nY0iwZBxVNq3xepVygfDiVHpi7GcMoFGsm.servername; domain=null; path=/app
            cookie=JSESSIONIDSSO=pt4XmsDzWWpyE3Gsqp0cA5n1Ourt-WY_X_kntY-8; domain=null; path=/
            header=Connection=close
            header=X-Powered-By=Undertow/1
            header=Set-Cookie=JSESSIONID=BmEsI_nY0iwZBxVNq3xepVygfDiVHpi7GcMoFGsm.servername; path=/app
            header=Set-Cookie=JSESSIONIDSSO=pt4XmsDzWWpyE3Gsqp0cA5n1Ourt-WY_X_kntY-8; path=/
            header=Server=WildFly/9
            header=Content-Type=application/json
            header=Content-Length=23
            header=Date=Tue, 06 Sep 2016 01:48:05 GMT
            status=200


More information about the undertow-dev mailing list