SAML Config for Author for Alternate Path
We have SAML authentication working on AEM Author 6.5 SP13. Users can visit the author at https://author and are redirected to the IdP. On successful authentication at the IdP, they get redirected back to https://author and are logged in.
I have the need to use SAML authentication not on the default/root (i.e. not on https://author) - but on an alternate path. I specified this in the "Path" parameter of the "Adobe Granite SAML 2.0 Authentication Handler" config, e.g. /foo
This path does not exist in the repository.
Ideally, users who know this https://author/foo URL are directed to the IdP for authentication and those who visit the root (i.e. https://author) use local authentication.
It seems to be working except, users who visit https://author/foo cannot authenticate, they receive an "Authentication Failed" error.
If the "Path" parameter of "Adobe Granite SAML 2.0 Authentication Handler" config is switched from /foo back to / - SAML authentication works - but again, for / - we'd prefer to use local authentication.
When using /foo - in the logs there's a warning about:
org.apache.sling.auth.core.AuthUtil isRedirectValid: Redirect target must not be empty or null (there is not much info on what this warning actually means).
When the metadata for the author/SP was shared with the IdP initially, the following element is present:
<md:AssertionConsumerService
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://author/saml_login"
index="1" />
I found the following: https://helpx.adobe.com/au/experience-manager/kb/saml-demo.html
Sitewide Anonymous Access with Optional Authentication
The authentication handler is built around protecting content from anonymous access via the Path configuration. If all pages on the AEM site need to be accessible anonymously, but authentication also needs tobe an option, the Path configuration value can be set to a non-existent path. This will enable SAML authentication but also allow anonymous access to all pages on the site. If this strategy is used, make sure that the SAMLReponse POSTs to the correct saml_login path (see next item).
The Path configuration and saml_login
The IdP’s SAMLResponse must be posted to the page ‘saml_login’. However, the ‘saml_login’ page must be within the path that the authentication handler protects (i.e. the Path configuration). For instance, if the Path configuration is ‘/‘ the IdP can post to http://localhost:4502/saml_login. If the Path is ‘/content/geometrixx’ the IdP can post to http://localhost:4502/content/geometrixx/saml_login or http://localhost:4502/content/geometrixx/does-not-exist/saml_login but http://localhost:4502/content/saml_login will not work.
If I asked the IdP to update the metadata to the following:
<md:AssertionConsumerService
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://author/foo/saml_login"
index="1" />
Would I be able to authenticate to the author at https://author/foo with the IdP and continue to use local authentication at https://author ? The documentation quoted mentions a /content/... path though also talks about non-existing paths (as in /foo) - will purely non-existing paths (like /foo) work?
Is it possible to have multiple of these IdP elements? For example, If I wanted to also have SAML authentication at https://author/bar - could I ask the IdP to have an additional element like:
<md:AssertionConsumerService
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://author/bar/saml_login"
index="1" />
Or if SAML doesn't allow the IdP to have multiple of these, would using a single prefix like:
<md:AssertionConsumerService
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://author/foo/saml_login"
index="1" />
And then asking users to either login at https://author/foo or https://author/foo/bar work? Assume /foo and /foo/bar are specified in "Path" parameter of the "Adobe Granite SAML 2.0 Authentication Handler" config.
Thanks for any info!