We are evaluating Sling for a multitenancy app. Nothing is shared between
tenants and we need to be able to move tenants across servers. So we plan to
create a workspace for each tenant. In order not to interfere with Sling
paths, the workspace is coded into the host name, e.g.
hugosworkspace.example.org. We thought about adding the workspaceName to
AuthenticationInfo(String authType, Credentials credentials, String
workspaceName). And then add it in SlingAuthenticator:

Index: SlingAuthenticator.java
===================================================================
--- SlingAuthenticator.java    (revision 712084)
+++ SlingAuthenticator.java    (working copy)
@@ -217,7 +217,7 @@
             try {
                 log.debug("authenticate: credentials, trying to get a
session");
                 Session session = getRepository().login(
-                    authInfo.getCredentials(), null);
+                    authInfo.getCredentials(),
authInfo.getWorkspaceName());

                 // handle impersonation
                 session = handleImpersonation(req, res, session);


This does not change the current behaviour but gives us an API for changing
the workspace with a custom AuthenticationHandler. sudoParameterName and
Sling-handled anonymous sessions are not possible for tenants but that does
not matter for our use case.

What do you think?
Marc

Reply via email to