I note that this has been acknowledge in many other threads here. Nowhere have I found a discussion of any possible solutions to this problem though.
I’m developing a Multi-Domain SSO Access Policy with the goal of consolidating logins for a range of different systems/technologies. Included in the list of target systems are ADFS 3.0 and Shibboleth IdP’s.
I’ve considered putting them on the “Primary Authentication URI” such that if users login with apm.mydomain.com/my.policy, ADFS pool would hang off apm.mydomain.com/adfs and Shibboleth pool hangs off apm.mydomain.com/idp. This should work for any internal Service Providers, as I can simply apply the Access Profile to those virtual servers so as to ensure they login and get a working session that’ll apply to the IdP’s before they can hit the SP application (hence no additional redirects when the application POSTs it’s SAMLRequest). However, this doesn’t cover me for the scenario of externally hosted Service Providers (which is kind of the point of SAML). How do I make this work?
Possibly related question, does an F5 SAML IdP behind APM suffer the same fate? I wouldn’t be looking forward to reconfiguring everything to use a new IdP, but if that’s the only option I’d consider it.
Lacking any better suggestion, I’ve found one option available is to decode the post data to determine which SP the request is attempting to start a session for. Then use that information to craft an idpinitiated GET request. Some SP also seem to provide enough information to do this in the RelayState URL parameter. Is this a terrible approach?
I think it was called the relying party id for ADFS. It’s not to hard to implement and seems to work fine, I’m just wondering if it’s the best thing to do. I’ve still not got it working for our Shibboleth instance, I think I need to enable IdPUnsolicitedSSO, which seems to be frowned upon… https://wiki.shibboleth.net/confluence/display/SHIB2/IdPUnsolicitedSSO
I’ve convinced myself that there’s nothing wrong with translating the POST request to an idpinititated GET request redirect. All you lose is the ability for ADFS to detect a “relay attack”, which is apparently just a DoS threat for ill prepared IdP platforms (ASM can mitigate against that probably more effectively). Relay attacks and idpinititated login presents no additional security risks to the Service Provider, which is all I was really concerned about.
In the case where I couldn’t determine what SP had generated the SamlRequest, I ended up forwarding the post data to a web service to tell me which IdPInitiated GET request I needed to generate. Using the HTTP Super Sideband library. I couldn’t find a TCL way to crack open the SAMLRequest.
As a more generic solution to the lost POST data issue, I also toyed with recording the POST data from the payload and then later generating a form that auto-submits with some javascript. This worked but hurt my soul.
“This worked but hurt my soul.” I know what you mean
Well, for what it’s worth, my current solution is this. When a new SAML request arrives, if it’s GET: proceed trough APM as usual.
If it’s POST: if user is already APM authenticated: POST gets trough the back-end. I supply the credentials I got inside the APM session using HTTP Basic Auth. Works perfectly.
If it’s POST and user is NOT APM authenticated: I allow the initial SAML request to go to the back-end. I also add a token to the query string in the received Location header I get from the back-end.
Then the client asks for this URL with the token and goes trough the APM flow. At the end, when APM is complete and request will get trough to the back-end, I recognize the token and I enable forms based authentication so the user never sees the login form.
Don’t know if this is useful in other situations.
Only problem is that I assume that the first form I get is the user/pass form in the special situation I describe. Shibboleth IdP does not work with HTTP Basic Auth after the initial SAML POST/GET. And you know what they say about assumptions…
Still searching for a way to be sure that the presented form is the login form.
“This worked but hurt my soul.” I know what you mean
Well, for what it’s worth, my current solution is this. When a new SAML request arrives, if it’s GET: proceed trough APM as usual.
If it’s POST: if user is already APM authenticated: POST gets trough the back-end. I supply the credentials I got inside the APM session using HTTP Basic Auth. Works perfectly.
If it’s POST and user is NOT APM authenticated: I allow the initial SAML request to go to the back-end. I also add a token to the query string in the received Location header I get from the back-end.
Then the client asks for this URL with the token and goes trough the APM flow. At the end, when APM is complete and request will get trough to the back-end, I recognize the token and I enable forms based authentication so the user never sees the login form.
Don’t know if this is useful in other situations.
Only problem is that I assume that the first form I get is the user/pass form in the special situation I describe. Shibboleth IdP does not work with HTTP Basic Auth after the initial SAML POST/GET. And you know what they say about assumptions…
Still searching for a way to be sure that the presented form is the login form.
I’ve managed to avoid Shibboleth so far, but I was looking at IdPAuthRemoteUser with some hope. As long as it doesn’t try to use AJP protocol and just blindly accepts the header, it might be possible to inject REMOTE_USER via HTTP_REQUEST_RELEASE.
Also, have you tried setting ACCESS::disable until a GET request is detected that’s certainly going to land the user on the Shibboleth login page? I’ve used that technique with one rather complex site in the past. I had a site that used NTLM but the NTLM SSO Profile didn’t work because it would ignore the NTLM header sent by APM until after a WWW-Authenticate was sent from the application server (the request that sent the WWW-Authenticate header was triggered by a redirect).
Just a quick note that APM behaviour may have changed since I originally posted this question. Or perhaps I hadn’t fully investigated the post data behaviour if multi-domain SSO wasn’t applied to the IdP site.
I’ve noticed that using a single domain to reverse proxy all your IdP technologies as suggested, e.g. apm.mydomain.com/adfs and apm.mydomain.com/idp works just fine as APM now seems to retain a copy of the post data in the request that triggered the login page redirect (in this case apm.mydomain.com/my.policy). So external Service Providers that post SAMLRequest to these either of these IdP’s seem to get through fine.
Post data is only lost if the initial post is to one of the multi-domain sites not hanging off of the Primary Authentication URI. That issue still appears to be outstanding as of 12.1.