<div dir="auto"><div>From my understanding, I was thinking/planning to create my own SessionManager to handle the Session loading.  And from the docs, it indicates that the SessionManager must delegate retrieving the sessionId to the SessionConfig object.</div><div dir="auto"><br></div><div dir="auto">Am I heading down the wrong path?  Is there an easier/another way to load/persist the session? </div><div dir="auto"><br></div><div dir="auto">Thanks</div><div dir="auto"><br></div><div dir="auto">Eric</div><div dir="auto"><br></div><div dir="auto"><br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On Mar 29, 2017 7:01 AM, &quot;Bill O&#39;Neil&quot; &lt;<a href="mailto:bill@dartalley.com">bill@dartalley.com</a>&gt; wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">If you want such a custom solution why not just use a cookie and ignore all of the <span style="font-size:12.8px">SessionConfig code. You can write a handler that checks for the cookie and attaches your own custom session object to the exchange based on the cookie.</span></div><div class="elided-text"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 28, 2017 at 9:41 PM, Eric B <span dir="ltr">&lt;<a href="mailto:ebenzacar@gmail.com" target="_blank">ebenzacar@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Stuart,<div><br>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:</div><div>1) I would like to sign the JSESSIONID</div><div>2) I would like to pass additional data along with the JSESSIONID (ex: some auth claims)</div><div>3) I want to be able to share this information between different containers</div><div>4) I want to pass a TTL with my token</div><div><br></div><div><br></div><div>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&#39;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).</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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 </div> SessionConfig.SessionCookieSo<wbr>urce 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.<div><br></div><div>Any help/insight would be greatly appreciated.</div><div><br></div><div>Thanks,</div><div><br>Eric</div><div><br></div></div><div class="m_-3667385676312723287HOEnZb"><div class="m_-3667385676312723287h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 28, 2017 at 7:57 PM, Stuart Douglas <span dir="ltr">&lt;<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Why do you need a custom SessionConfig? In general Servlet will use<br>
its own SessionConfig that matches the configuration of the deployed<br>
application (generally just using a JSESSIONID cookie, unless it has<br>
been customized).<br>
<br>
Stuart<br>
<div><div class="m_-3667385676312723287m_-5870665426442319891h5"><br>
On Tue, Mar 28, 2017 at 2:19 PM, Eric B &lt;<a href="mailto:ebenzacar@gmail.com" target="_blank">ebenzacar@gmail.com</a>&gt; wrote:<br>
&gt; I&#39;ve been trying to figure out how to build my own custom SessionManager to<br>
&gt; push my sessions into Redis with a custom SessionConfig implementation, but<br>
&gt; am having trouble finding any documentation to that extent.<br>
&gt;<br>
&gt; For the SesisonManager, I&#39;ve read that I need to:<br>
&gt;<br>
&gt; Develop SessionManager which implements<br>
&gt; io.undertow.server.session.Ses<wbr>sionManager<br>
&gt; Develop SessionManagerFactory which implements<br>
&gt; io.undertow.servlet.api.Sessio<wbr>nManagerFactory<br>
&gt; Develop startup extension which implements<br>
&gt; io.undertow.servlet.ServletExt<wbr>ension, and in handleDeployment(Deployment)<br>
&gt; method change sessionManagerFactory with new SessionManagerFactory.<br>
&gt; Register new ServletExtension by adding<br>
&gt; ../META-INF/services/io.undert<wbr>ow.servlet.ServletExtension file (file should<br>
&gt; contain the name of new ServletExtension. for example<br>
&gt; com.my.utils.StartupExtension)<br>
&gt;<br>
&gt;<br>
&gt; But I can&#39;t seem to find anything that indicates how to provide my own<br>
&gt; SessionConfig implementation.  How do I register a custom SessionConfig<br>
&gt; implementation?  Is there any documentation to that extent?<br>
&gt;<br>
&gt; Are there any examples that can show me how to create my own SessionManager<br>
&gt; and SessionConfig object?<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Eric<br>
&gt;<br>
</div></div>&gt; ______________________________<wbr>_________________<br>
&gt; undertow-dev mailing list<br>
&gt; <a href="mailto:undertow-dev@lists.jboss.org" target="_blank">undertow-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/undertow-dev</a><br>
</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
undertow-dev mailing list<br>
<a href="mailto:undertow-dev@lists.jboss.org" target="_blank">undertow-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/undertow-dev</a><br></blockquote></div><br></div>
</div></blockquote></div><br></div></div></div>