I'll try to elaborate a bit on this.
The getContextPath is used in these places:
- in SAMLDiscovery it is possible to include the reverse-proxy friendly address in SP metadata. I will add a possibility to define it also in ExtendedMetadata which will make it easier to customize the value.
- in SAMLEntryPoint it is already possible to set custom discoveryURL in the ExtendedMetadata of the entity.
- in the SAMLContextProvider the only relevant part is /alias/... and not the first part of the context. This should make it sufficiently reverse-proxy friendly.
So the options are either setting the ExtendedMetadata with customized discovery URLs or not using IDP Discovery at all by setting HTTP request parameter "idp" or setting defaultIDP value on MetadataManager.
I will also update the management UI so that entityBaseURL value is used to configure all places in SP metadata correctly once IDP discovery is enabled.
Will this cover all your use-cases?