<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hello, Stuart.</p>
<p><br>
</p>
<p>First of all, thank you for your suggestion.</p>
<p>Second, sorry for my lack of feedback,&nbsp;I've being away from this task in the last days.</p>
<p><br>
</p>
<p>I did as you said, but I've had no success yet.</p>
<p>Setting changeSessionIdOnLogin to false, avoids the first attempt to create a new session, in CachedAuthenticatedSessionHandler class. But just after that, session will be created, and of course, with a new session id.</p>
<p><br>
</p>
<p>If I also set cacheable to false, when invoking authenticationComplete, so no session&nbsp;will be created<span style="font-family:Calibri,Arial,Helvetica,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,NotoColorEmoji,&quot;Segoe UI Symbol&quot;,&quot;Android Emoji&quot;,EmojiSymbols; font-size:16px">&nbsp;at
 all</span>. But somehow, the authentication mechanism enters in a&nbsp;loop even with my AuthenticationMechanism returning AUTHENTICATED.</p>
<p><br>
</p>
<p>It seems that I am unable to finish my authentication without an instance of HttpSession created, is this expected?</p>
<p><br>
</p>
<p>What else could I do?&nbsp;&nbsp;</p>
<p><br>
</p>
<div id="x_Signature">_______________<br>
Vinicius Kopcheski<br>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>De:</b> Stuart Douglas &lt;sdouglas@redhat.com&gt;<br>
<b>Enviado:</b> segunda-feira, 3 de outubro de 2016 18:28:01<br>
<b>Para:</b> Vinicius F. Kopcheski<br>
<b>Cc:</b> undertow-dev@lists.jboss.org<br>
<b>Assunto:</b> Re: [undertow-dev] Legacy SSO system integration</font>
<div>&nbsp;</div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Can you try setting<br>
'io.undertow.servlet.api.DeploymentInfo#changeSessionIdOnLogin' to<br>
false? By default Undertow will generate a new session ID when you<br>
authenticate as a precaution.<br>
<br>
Stuart<br>
<br>
On Tue, Oct 4, 2016 at 8:19 AM, Vinicius F. Kopcheski<br>
&lt;viniciusfk@hotmail.com&gt; wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt;<br>
&gt; I'm working to integrate a legacy SSO system with undertow (Wildfly 10), and<br>
&gt; this SSO is also used with JBoss 4 and 6.<br>
&gt;<br>
&gt;<br>
&gt; Its strategy is to share the same JSESSIONID between all the applications<br>
&gt; running inside all those servers.<br>
&gt;<br>
&gt;<br>
&gt; In my custom Authentication Mechanism, I retrieve the session id that will<br>
&gt; be used for this session, but just after invoking<br>
&gt; SecurityContext#authenticationComplete, a new session is created, which<br>
&gt; takes me to have two session cookies. I mean, they both are named<br>
&gt; JSESSIONID.<br>
&gt;<br>
&gt;<br>
&gt; I could find a way to remove this one created by undertow, but I'm not sure<br>
&gt; this is the best approach.<br>
&gt;<br>
&gt;<br>
&gt; What do you suggest me to do is this scenario?<br>
&gt;<br>
&gt;<br>
&gt; _______________<br>
&gt; Vinicius Kopcheski<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; undertow-dev mailing list<br>
&gt; undertow-dev@lists.jboss.org<br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev">https://lists.jboss.org/mailman/listinfo/undertow-dev</a><br>
</div>
</span></font>
</body>
</html>