Hello,

I was checking out the sling authentication requirements in AEM, and I noticed 
that they work fine until I try them using a url that is mapped through 
/etc/maps. I’ve done some research and it seems like this is not supported by 
Sling at all.

Particularly I checked the isAnonAllowed method from the SlingAuthenticator 
class, which has this snippet when comparing the path being access with the 
ones in the authentication requirements:


 for (AuthenticationRequirementHolder holder : holders) {
                    if (path.startsWith(holder.path)) {
                        return !holder.requiresAuthentication();
                    }
                }

I think that the path.startsWith(holder.path) bit could be refactored to take 
into consideration the available mappings, but I am not so sure of how to 
proceed. The easiest way I can think of is using resourceResolver.map(request, 
path) before comparing the paths, but authentication is a tricky topic and I 
would like your input before trying it out.

Maybe the responsibility of managing the mappings should be in the services 
that register the paths in the first place? If that so, then should stay as it 
is and I can create a service that fit my project’s needs.

WDYT?


Santiago García Pimentel| Sr Software Engineer
Netcentric Ibérica SLU
M: +34687915463
[email protected] <mailto:[email protected]> | 
www.netcentric.biz <http://www.netcentric.biz/>

Reply via email to