<div dir="ltr">Hi.
<br><br>In our environment, both IdP and SP reside behind a reverse 
proxy, and both IdP and SP have the same host name, but the context path
 is different (e.g. SP's url - <a href="http://abc.example.com/sp/" target="_top" rel="nofollow">http://abc.example.com/sp/</a>, IdP's url - <a href="http://abc.example.com/idp/" target="_top" rel="nofollow">http://abc.example.com/idp/</a>).
<br><br>However, the subdomain part of the url may differ depending on 
the environment from which users access the system, e.g. SP's url can be
 <a href="http://abc.example.com/sp/" target="_top" rel="nofollow">http://abc.example.com/sp/</a> or <a href="http://xyz.example.com/sp/" target="_top" rel="nofollow">http://xyz.example.com/sp/</a> (but in the end the user will use the same system).
<br><br>This means that I cannot not know the full url of the IdP or SP in advance. E.g if users uses <a href="http://xyz.example.com/sp/" target="_top" rel="nofollow">http://xyz.example.com/sp/</a> for accessing the SP, then the URL for the IdP must be dynamically set to <a href="http://xyz.example.com/idp/" target="_top" rel="nofollow">http://xyz.example.com/idp/</a> and not <a href="http://abc.example.com/idp/" target="_top" rel="nofollow">http://abc.example.com/idp/</a> for example. And vice versa (IdP must respond to correct 
<br><br>Here are some abstract options that I could think of (but none of them is fully developed).
<br><br>Option 1. Relative urls for the endpoints in metadata for both IdP and SP. 
<br><br>Is this possible / allowed at all from SAML perspective? Are there any issues I need to worry about? 
<br><br>Option 2. Hack into SP's and IdP's assertions creation logic in 
order to set correct URL for HTTP-POST bindings (we only use post 
bindings)
<br><br>Option 3. SP could treat IdP on different hosts as different IdPs (and the other way around). However there are several issues:
<br><br> - there is just one physical IdP and its entity ID is fixed. 
However SP's will need to hold multiple metadata for IdP and it will 
need to have different entity ID.
<br>- the same issue with SP.
<br><br>Any ideas how I can solve this problem? 

        
        
        
        </div>