Tuesday, April 18, 2023

AEM(Adobe Experience Manager) - com.day.cq.wcm.foundation.forms.impl.MailServlet Invalid redirect specified:

 You may get the following error while using the AEM mail action to send the details captured through an AEM form(form built based on AEM foundation or core form components)

org.apache.sling.auth.core.AuthUtil isRedirectValid: Redirect target must not be an URL 

com.day.cq.wcm.foundation.forms.impl.MailServlet Invalid redirect specified:

This error can happen in multiple scenarios; some are below

Defining the external page as the Thank you page for the form - AEM Mail Servlet won't support external URLs as the thank you page due to security restriction

Defining the internal AEM page with complete URL, including protocol and domain - Even though the AEM page sites inside the AEM, as you specified the full URL, the mail servlet treat the URL as external.

Mismatch in the etc. map configuration - The etc. map configuration will help you to map the content path to the complete URLs - domain mapping with shortened URL based on your setup; if your etc. map configuration is enabled with the upper case for the domain names(e.g., www.Test.com), then you will see this issue even though only the content path specified as the thank you page. The reason is the Mail servlet URL comparison is case sensitive, even though the form URL and the thank you page URL are enabled through the same domain. 

No comments:

Post a Comment