Stuart,
My goal is to actually replace the JSESSIONID cookie/mechanism with my own mechanism. I am looking to use a JsonWebToken (JWT) to pass my JSESSIONID to the application for a few different reasons:
1) I would like to sign the JSESSIONID
2) I would like to pass additional data along with the JSESSIONID (ex: some auth claims)
3) I want to be able to share this information between different containers
4) I want to pass a TTL with my token
At some level, I am trying to hack together an SSO solution temporarily which would allow me to log into one container, and have some credentials pass to another container. My issue is that both containers are session based, and hence, need to be able to retrieve a session from a sessionId. However, I also want to make sure that sessions don't expire - that is if I am working in container 2, that my session in container 1 continues to live (if the user gets redirected back to container 1).
So, in essence, I am looking to be able to extract my SessionId from a mechanism other than the standard JSESSIONID cookie, but yet, still continue to use the sessions seamlessly.
I figure I could potentially hack around the design using the SessionConfigWrapper in which I use the wrap() method to return my own SessionConfig object, but that does not seem to fit in the spirit or design of the wrapper.
Is there another/better way to accomplish something like this? Or is undertow designed with only the JSESSIONID cookie in mind? I did notice the
SessionConfig.SessionCookieSource enum with value OTHER, but cannot seem to see/figure out where that is used, or how to leverage that setting. I looked through the ServletContextImpl class but only see the SessionTrackingMode of COOKIE, SSL and URL available.
Any help/insight would be greatly appreciated.
Thanks,
Eric