<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>
<div>Sorry Justin, still having problems connecting both. From the OAuth negotiation point of view (Authorization Code flow), which exact step is affected by a discrepancy in those two fields?</div>
<div><br>
</div>
<div>The failure we are observing happens at the point where the server tries to display the approval form, the login works fine. Even in that case the issuer configured in MitreId is correct in the sense that there is a valid listener there. Our simplified
 test environment consists of a single Tomcat and client running on the same machine, no load balancer or Apache. &nbsp;In particular, why 127.0.0.1 is different than localhost for the authorization code flow? We can successfully login directly to MitreId using
 either.</div>
<div><br>
</div>
<div>I do understand that if the client tries to use the issuer field from the JWT token provided by MitreId, that may cause some problems but that is something else. The failure we are observing is before that.</div>
<div><br>
</div>
<div>Regards,</div>
<div>Luiz</div>
<div>
<div id="MAC_OUTLOOK_SIGNATURE"></div>
</div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Justin Richer<br>
<span style="font-weight:bold">Date: </span>Tuesday, November 24, 2015 at 6:37 PM<br>
<span style="font-weight:bold">To: </span>Luiz Omori<br>
<span style="font-weight:bold">Cc: </span>&quot;<a href="mailto:mitreid-connect@mit.edu">mitreid-connect@mit.edu</a>&quot;<br>
<span style="font-weight:bold">Subject: </span>Re: [mitreid-connect] Redirected back to main page??<br>
</div>
<div><br>
</div>
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Yes, this is by design. Your issuer URL needs to be the <b class="">same URL</b> used to make the requests, regardless of the machine that the server is running on. Otherwise nothing will work! For example, many instances I’ve run have Tomcat running on localhost:8080
 and not listening to the outside world, but fronted by apache. The issuer URL is whatever URL the apache server is fronting, not what Tomcat uses internally.
<div class=""><br class="">
</div>
<div class="">&nbsp;— Justin</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Nov 24, 2015, at 5:31 PM, Luiz Omori &lt;<a href="mailto:luiz.omori@duke.edu" class="">luiz.omori@duke.edu</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">
<div class=""><font face="Calibri" class="">Oh, I could reproduce the exact same behaviour by just having the issuer property defined in the server-config.xml different than the root url used to make the requests. For example, my server-config.xml has issuer&nbsp;&quot;<a href="http://127.0.0.1:8080/ldap-openid-connect-server" class="">http://127.0.0.1:8080/ldap-openid-connect-server</a>/“
 and my test client is calling&nbsp;</font><a href="http://localhost:8080/ldap-openid-connect-server/authorize" class="">http://localhost:8080/ldap-openid-connect-server/authorize</a><font face="Calibri" class="">. Since I’m running everything on my laptop they
 are semantically identical. If both are either 127.0.0.1 or localhost it works. Is this by design?&nbsp;</font></div>
<div style="" class=""><font face="Calibri" class=""><br class="">
</font></div>
<div style="" class=""><font face="Calibri" class="">Regards,</font></div>
<div style="" class=""><font face="Calibri" class="">Luiz</font></div>
<div style="" class="">
<div id="" class=""></div>
</div>
</div>
<div style="font-size: 14px; font-family: Calibri, sans-serif;" class=""><br class="">
</div>
<span id="OLK_SRC_BODY_SECTION" style="font-size: 14px; font-family: Calibri, sans-serif;" class="">
<div style="font-family: Calibri; font-size: 12pt; text-align: left; border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0in 0in; border-top-color: rgb(181, 196, 223);" class="">
<span style="font-weight:bold" class="">From: </span>Justin Richer<br class="">
<span style="font-weight:bold" class="">Date: </span>Tuesday, November 24, 2015 at 2:54 PM<br class="">
<span style="font-weight:bold" class="">To: </span>Luiz Omori<br class="">
<span style="font-weight:bold" class="">Cc: </span>&quot;<a href="mailto:mitreid-connect@mit.edu" class="">mitreid-connect@mit.edu</a>&quot;<br class="">
<span style="font-weight:bold" class="">Subject: </span>Re: [mitreid-connect] Redirected back to main page??<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
I’m talking about something related to tomcat itself:
<div class=""><br class="">
</div>
<div class=""><a href="https://www.mulesoft.com/tcat/tomcat-clustering" class="">https://www.mulesoft.com/tcat/tomcat-clustering</a></div>
<div class=""><br class="">
</div>
<div class="">If there’s only one instance of the server though then it should work fine so long as the load balancer is passing all headers (like cookies) through to the other side. Most common deployments of this software in enterprise space use a reverse
 proxy of some type, so a single-instance load balancer shouldn’t be different from that.</div>
<div class=""><br class="">
</div>
<div class="">&nbsp;— Justin</div>
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On Nov 24, 2015, at 2:21 PM, Luiz Omori &lt;<a href="mailto:luiz.omori@duke.edu" class="">luiz.omori@duke.edu</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;" class="">
<div class="">
<div class="">
<div class="">Are you talking about MitreId own DB (in-memory versus MySQL versus …) or something else purely related to Tomcat?</div>
<div class=""><br class="">
</div>
<div class="">In any case for now we have only one MitreId instance behind the load balancer as the second instance is not ready yet.</div>
<div class=""><br class="">
</div>
<div class="">Regards,</div>
<div class="">Luiz</div>
<div class="">
<div id="" class=""></div>
</div>
</div>
</div>
<div class=""><br class="">
</div>
<span id="OLK_SRC_BODY_SECTION" class="">
<div style="font-family: Calibri; font-size: 12pt; text-align: left; border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0in 0in; border-top-color: rgb(181, 196, 223);" class="">
<span style="font-weight:bold" class="">From: </span>Justin Richer<br class="">
<span style="font-weight:bold" class="">Date: </span>Tuesday, November 24, 2015 at 2:18 PM<br class="">
<span style="font-weight:bold" class="">To: </span>Luiz Omori<br class="">
<span style="font-weight:bold" class="">Cc: </span>&quot;<a href="mailto:mitreid-connect@mit.edu" class="">mitreid-connect@mit.edu</a>&quot;<br class="">
<span style="font-weight:bold" class="">Subject: </span>Re: [mitreid-connect] Redirected back to main page??<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Do you have Tomcat’s shared session mechanism set up on your servers? You have to do that with a load-balanced setup otherwise things that are stored in the session object (like the target page after a login) will get lost.
<div class=""><br class="">
</div>
<div class="">&nbsp;— Justin</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On Nov 24, 2015, at 2:16 PM, Luiz Omori &lt;<a href="mailto:luiz.omori@duke.edu" class="">luiz.omori@duke.edu</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;" class="">
<div class="">Hi,</div>
<div class=""><br class="">
</div>
<div class="">We are having a problem with MitreId Connect when it’s behind a load balancer. Everything works as expected when we hit it directly but when we use the load balancer address the server does the authentication however instead of redirecting the
 authorization code back to the client it appears to send it to MitreId main page, with the user logged in to it. In the latter case, we even don’t see the approval form.&nbsp;</div>
<div class=""><br class="">
</div>
<div class="">Regards,</div>
<div class="">Luiz</div>
<div class="">
<div id="" class=""></div>
</div>
</div>
_______________________________________________<br class="">
mitreid-connect mailing list<br class="">
<a href="mailto:mitreid-connect@mit.edu" class="">mitreid-connect@mit.edu</a><br class="">
<a href="http://mailman.mit.edu/mailman/listinfo/mitreid-connect" class="">http://mailman.mit.edu/mailman/listinfo/mitreid-connect</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</span></div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</span></div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</span>
</body>
</html>