HI Team,
How is aem servlet with resourcetype is more secure than aem servlet with path based.
Thanks in advance.
Views
Replies
Total Likes
Hi @Keerthi0555
You can control the access and permissions on the JCR node of the given resource for which you registered the servlet.
Views
Replies
Total Likes
Hi @Keerthi0555
Sling Servlet in AEM – AEM CQ5 Tutorials
When we register a servlet using path, we must be specific what all paths are allowed as If we define something randomly, our servlet might not be function properly. Only a limited set of paths are allowed and the rest are blocked. We can add more path using Apache Sling Servlet / Script Resolver and Error Handler. Allowing more paths to execute servlet to make your application vulnerable. like below image
That’s why you should not open more doors for servlets to run until and unless it is required. You might also need to tell specific paths to your consumers, who are consuming servlet response using ajax and any change in that path could have a serious affect. This might not be the case when you use resourceType. Sling Engine will take care of permissions if you register servlet using Resource Type. Users who cannot access a particular resource will not be able to invoke the servlet.
Hi @Keerthi0555,
to summarize, including all the points already raised:
Hope this helps,
Daniel