We are in process of upgrading our application from Wildfly 10.1.0 to Wildfly 18.0.1. We are stuck with an issue of Wildfly sending set-cookie in the middle of a session.
After successful login, “j_security_check” response returns set-cookie header and we were expected this to not change in the middle of the session. This has been true so far with WIldfly 10.
The problem now we see is that Wildfly randomly sends set-cookie header in response to any subsequent request and authentication at our application level fails.
We are using distributed web cache as defined in standalone-ha configuration except that the transaction mode is NONE.
<cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">
<transport lock-timeout="60000"/>
<replicated-cache name="sso">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
</replicated-cache>
<replicated-cache name="routing"/>
<distributed-cache name="dist">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="NONE"/>
<file-store/>
</distributed-cache>
</cache-container>
Any pointers will be appreciated.
Thanks,
Vikram
14-Mar-2020 13:58:23,743 UTC DEBUG [] [security] (default task-9) || Attempting to authenticate /abc/xyz, authentication required: true
14-Mar-2020 13:58:23,743 UTC DEBUG [] [security] (default task-9) || Authentication outcome was NOT_ATTEMPTED with method io.undertow.security.impl.CachedAuthenticatedSessionMechanism@61a96c52 for /abc/xyz
14-Mar-2020 13:58:23,743 UTC DEBUG [] [security] (default task-9) || Authentication outcome was NOT_ATTEMPTED with method io.undertow.security.impl.BasicAuthenticationMechanism@1634ec4f for /abc/xyz
14-Mar-2020 13:58:23,743 UTC DEBUG [] [security] (default task-9) || Authentication outcome was NOT_ATTEMPTED with method io.undertow.servlet.handlers.security.ServletFormAuthenticationMechanism@4bd204bd for /abc/xyz
14-Mar-2020 13:58:23,743 UTC DEBUG [] [security] (default task-9) || Sending authentication challenge for HttpServerExchange{ GET /abc/xyz}
Thanks Paul.
We are using legacy PicketBox framework instead of Elytron. In wildfly 10, once successfully authenticated, the JSESSIONID sent as part of "set-cookie" never changed in the middle of the session. Now, we see that Wildfly 18 is sending set-cookie with different JSESSIONID for any random request in the middle of session.
This issue we see in standalone Wildfly mode (Non cluster). Also, even in standalone mode, we use the above mentioned distributed cache configuration.
In Wildfly cluster mode, this might be an issue also though we have not tested it extensively.
Besides the scenario that you mentioned, what are the other scenarios where Wildfly can change the JSESSIONID in the middle of the session and how to disable this behavior? All the requests initiated by browser have valid JSESSIONID as returned after successful authentication.