<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</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>I apologize in advance for what will, I'm sure, be a someone rambling post... I'm at a level of ignorance on this issue that makes it hard for me to even describe it clearly, so at this point I'm just hoping for some pointers as to where I should start
 looking to better understand what's going on.</div>
<div><br>
</div>
<div>I have several virtual hosts running in the same instance of Apache, using the same instance of shibd and the same shibboleth2.xml file. However, the vhosts are in different domains. In this example I have two web sites secured by Shibboleth, dash-dev.ucop.edu
 and dash-dev.berkeley.edu. Each vhost has its own set of Shibboleth configuration statements. The Shibboleth config is very simple:</div>
<div><br>
</div>
<div>
<div># Start of Shibboleth config</div>
<div><br>
</div>
<div># Protect everything with Shibboleth authentication</div>
<div>&nbsp; &lt;Location /&gt;</div>
<div>&nbsp; &nbsp; &nbsp;AuthType shibboleth</div>
<div>&nbsp; &nbsp; &nbsp;ShibRequestSetting requireSession 1</div>
<div>&nbsp; &nbsp; &nbsp;require shibboleth</div>
<div>&nbsp; &nbsp; &nbsp;ShibUseHeaders On</div>
<div>&nbsp; &nbsp; &nbsp;SSLRequireSSL</div>
<div>&nbsp; &nbsp; &nbsp;Allow from all</div>
<div>&nbsp; &lt;/Location&gt;</div>
<div><br>
</div>
<div># Exclude /xtf/* from Shibboleth authentication to allow free access to the search application</div>
<div>&nbsp; &lt;Location /xtf&gt;</div>
<div>&nbsp; &nbsp; &nbsp;Satisfy any</div>
<div>&nbsp; &lt;/Location&gt;</div>
<div><br>
</div>
<div>&nbsp; ######### End of Shibboleth config</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>The basic use case of an individual from a given domain logging in to the server for their domain works just fine. If I (a ucop.edu person) access dash-dev.ucop.edu I am redirected to my local EDS. I select the UCOP IDP from the list, provide my credentials
 to the UCOP IDP, and get redirected to the page on the dash-dev.ucop.edu site that I originally requested. The same use case works for a Berkeley person accessing the dash-dev.berkeley.edu site.</div>
<div><br>
</div>
<div>The glitch arises when a person attempts to go across domains. We want people to be able to access certain parts of other domain's sites freely (the search application), but when accessing the Shibboleth-protected areas, we want to force them back to their
 own domain. To accomplish this I added configuration to the Apache virtual hosts like this:</div>
<div><br>
</div>
<div>
<div>&nbsp; RewriteCond %{LA-U:ENV:Shib-Identity-Provider} ucop</div>
<div>&nbsp; RewriteRule ^/(.*)$ http://dash-dev.ucop.edu%{REQUEST_URI} [R,QSA,L]</div>
</div>
<div><br>
</div>
<div>That configuration is part of the setup for dash-dev.berkley.edu. It says that if a user comes into the Berkeley site with credentials that were validated by the UCOP IDP, their request is rewritten to send them to dash-dev.ucop.edu. Converse configuration
 for dash-dev.ucop.edu sends Berkeley users back to their home site. This works nicely, except for one odd behavior.</div>
<div><br>
</div>
<div>When the user is redirected from the Berkeley site to the UCOP site, they are sent through the EDS again first. They do not need to enter any credentials again. They simply need to select their IDP, and then they are immediately sent to the destination,
 directly from the EDS page, without going through the IDP. At least, that's how it looks from the browser. I guess it's possible that they are, under the covers, being sent to the IDP and then immediately sent to the UCOP site.</div>
<div><br>
</div>
<div>So what I see in this flawed use case is this:</div>
<div><br>
</div>
<div>1) User from UCOP goes to dash-dev.berkeley.edu</div>
<div><br>
</div>
<div>2) Shibd intercepts the request and diverts the user to the EDS page</div>
<div><br>
</div>
<div>3) User selects the UCOP IDP and enters their credentials</div>
<div><br>
</div>
<div>4) User is redirected to dash-dev.berkeley.edu, per their request in Step 1</div>
<div><br>
</div>
<div>5) Before the user sees anything in their browser, the rewrite rule in the configuration for dash-dev.berkeley.edu notices that their authentication came from UCOP and rewrites their request to dash-dev.ucop.edu</div>
<div><br>
</div>
<div>6) Shibd intercepts the request for dash-dev.ucop.edu, and even though the user has a valid session, sends them back to the EDS page</div>
<div><br>
</div>
<div>7) User selects the UCOP IDP and is immediately delivered to dash-dev.ucop.edu, without re-entering their credentials or even seeing the UCOP IDP.</div>
<div><br>
</div>
<div>Steps 6 and 7 are the problem. I don't understand why my SP is sending the user back to EDS when they already have a valid Shibboleth session. Can anyone give me some clues as to how to even begin to debug and resolve this? Or is this an expected behavior
 - just part of the way we expect Shibboleth to behave when crossing from one DNS domain to another?</div>
<div><br>
</div>
<div>--Ken</div>
<div><br>
</div>
<div>
<div>
<div style="font-family: Consolas; font-size: medium; ">------------------------------------------------------------</div>
<div style="font-family: Consolas; font-size: medium; ">Ken Weiss&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:ken.weiss@ucop.edu">ken.weiss@ucop.edu</a></div>
<div style="font-family: Consolas; font-size: medium; ">UC Office of the President&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;510-587-6311 (office)</div>
<div style="font-family: Consolas; font-size: medium; ">California Digital Library&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;916-905-6933 (mobile)</div>
<div style="font-family: Consolas; font-size: medium; ">UC Curation Center</div>
<div style="font-family: Consolas; font-size: medium; ">415 20th Street, 4th Floor</div>
<div style="font-family: Consolas; font-size: medium; ">Oakland, CA 94612</div>
</div>
<div><br>
</div>
</div>
</body>
</html>