Expand my Community achievements bar.

SOLVED

Enable Authentication Requirement for AEM Pages not working

Avatar

Level 1

Hi,

I have enabled the Authentication requirement for one of the pages on my project. This property should redirect any unauthenticated user to the log in page url but that's not working. The same is working for other pages within the project, granite:loginPath & rep:CugPolicy property values are the same. The Apache Sling AuthenticationHandler is configured, and confirmed the configuration at https://<serveraddress>:<serverport>/system/console/slingauth . Please help me debug this issue.

MPassi_0-1701212693478.png

 

Authentication Requirement section under the Advanced Page Properties



The Authentication Requirement for Log in page is set to No, for other pages Yes

MPassi_0-1701212225049.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @MPassi 


Check Page Properties:

  • Confirm that the granite:loginPath and rep:CugPolicy properties are correctly set on the page in question.
  • Verify that the login path is correctly configured to redirect unauthenticated users.

2. Review Apache Sling AuthenticationHandler Configuration:

  • Go to the AEM Web Console at https://<serveraddress>:<serverport>/system/console/configMgr.
  • Locate the Apache Sling AuthenticationHandler configuration.
  • Confirm that the login.resource property is set to the correct login page path.

3. Check Sling Authentication Status:

  • Go to https://<serveraddress>:<serverport>/system/console/slingauth.
  • Verify that the org.apache.sling.auth.core.impl.SlingAuthenticator is active.
  • Ensure that the loginPath property matches the configured login page path.

4. Verify Apache Sling Referrer Filter Configuration:

  • Confirm that the Apache Sling Referrer Filter is correctly configured.
  • Check the configurations related to login path and redirection.

5. Inspect Browser Network Requests:

  • Open your browser's developer tools.
  • Access the page in question and monitor the network requests.
  • Check if there are any redirects and verify the response codes.

6. Check AEM Logs:

  • Inspect the AEM error.log and access.log for any relevant entries.
  • Look for authentication-related messages or errors that might provide insights.

7. Test Other Authenticated Pages:

  • Verify if the issue persists across multiple authenticated pages.
  • Test the authentication behavior on pages where it is known to be working correctly.

8. Test with a New Page:

  • Create a new page and apply the same authentication requirements.
  • Check if the issue occurs on the new page, which might help isolate the problem.

9. Consider Dispatcher Configuration:

  • If you are using a dispatcher, check the dispatcher configuration for any rules or settings that might interfere with authentication.

10. Review Custom Code and Sling Models:

  • If you have custom Sling Models or other server-side code, review them for any logic that might affect authentication.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @MPassi 


Check Page Properties:

  • Confirm that the granite:loginPath and rep:CugPolicy properties are correctly set on the page in question.
  • Verify that the login path is correctly configured to redirect unauthenticated users.

2. Review Apache Sling AuthenticationHandler Configuration:

  • Go to the AEM Web Console at https://<serveraddress>:<serverport>/system/console/configMgr.
  • Locate the Apache Sling AuthenticationHandler configuration.
  • Confirm that the login.resource property is set to the correct login page path.

3. Check Sling Authentication Status:

  • Go to https://<serveraddress>:<serverport>/system/console/slingauth.
  • Verify that the org.apache.sling.auth.core.impl.SlingAuthenticator is active.
  • Ensure that the loginPath property matches the configured login page path.

4. Verify Apache Sling Referrer Filter Configuration:

  • Confirm that the Apache Sling Referrer Filter is correctly configured.
  • Check the configurations related to login path and redirection.

5. Inspect Browser Network Requests:

  • Open your browser's developer tools.
  • Access the page in question and monitor the network requests.
  • Check if there are any redirects and verify the response codes.

6. Check AEM Logs:

  • Inspect the AEM error.log and access.log for any relevant entries.
  • Look for authentication-related messages or errors that might provide insights.

7. Test Other Authenticated Pages:

  • Verify if the issue persists across multiple authenticated pages.
  • Test the authentication behavior on pages where it is known to be working correctly.

8. Test with a New Page:

  • Create a new page and apply the same authentication requirements.
  • Check if the issue occurs on the new page, which might help isolate the problem.

9. Consider Dispatcher Configuration:

  • If you are using a dispatcher, check the dispatcher configuration for any rules or settings that might interfere with authentication.

10. Review Custom Code and Sling Models:

  • If you have custom Sling Models or other server-side code, review them for any logic that might affect authentication.