Reputation: 147
I am running a AEM author service, in Apache Sling Authentication Service I didn't add /system/sling/junit/.html into Authentication Requirements, and Allow Anonymous Access is unchecked, but still could access /system/sling/junit/.html without login.
Upvotes: 0
Views: 454
Reputation: 1728
The JUnitServlet bypasses Sling-Authentication completely. If you look into the code, it registers directly as an OSGi servlet (via the OSGi http-service). It is registered parallel to the SlingMainServlet. So there is no way to enforce Sling Authentication from the outside. The JUnitServlet itself had to enforce Authentication (like the /system/console). It is open source, so you could add this feature in theory.
Also the documentation says, that it has no authentication:
Note that the JUnitServlet does not require authentication, so it would allow any client to run tests. The servlet can be disabled by configuration if needed, but in general the
/system
path should not be accessible to website visitors anyway.
Upvotes: 0