A developer is using sling context-aware configuration trying to get the configuration resource using:

This works as intended in author and in publish when logged in lo publish as admin. However this gives a null when run as anonymous. Which method is going to fix the issue?
The issue arises because the anonymous user does not have the necessary read permissions for the /content directory. When using Sling context-aware configurations, access to the configuration resource is required. If the anonymous user lacks read permissions, the configuration cannot be retrieved, resulting in a null value.
To fix this issue, you need to grant read permissions to the anonymous user for the /content directory.
Steps to apply read permissions:
Access CRXDE Lite: Log into your AEM instance and navigate to CRXDE Lite (http://localhost:4502/crx/de).
Navigate to the /content Directory: In the CRXDE Lite interface, browse to the /content directory.
Set Permissions:
Right-click on the /content directory and select 'Permissions'.
Add the anonymous user (if not already present).
Grant read permissions to the anonymous user.
Save Changes: Apply the changes and ensure that they are saved correctly.
Test the Configuration: Log out of the AEM instance and test the context-aware configuration as an anonymous user to ensure that the configuration resource can now be retrieved.
By granting read permissions to the anonymous user for the /content directory, you allow access to the necessary configuration resources, resolving the issue.
Trinidad
1 month agoCathern
1 month agoVictor
1 month agoSolange
2 months agoJacquelyne
2 months agoChaya
2 months agoWinfred
2 months agoJaney
2 months agoWilda
2 months agoMozell
3 months agoLeonora
3 months agoBurma
3 months agoBerry
4 months agoHan
4 months agoVince
4 months agoTommy
4 months agoMicheal
4 months agoVirgina
5 months agoPeggie
5 months agoLarue
5 months agoRory
5 months agoMireya
16 days agoTheresia
21 days agoJunita
26 days ago