Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Form post to absolute action url

Avatar

Level 2

Hi,

We need to be able to use an absolute action url in the AEM form component, this way we can post to a different domain than the one that is used to open the AEM page with the form on.

We already managed to set a custom, absolute action url to the form container.

However posting the form does not work; a blank page is shown after the submit and nothing is shown in the logs.

We think maybe a filter blocks this submit for security reasons, but we're not able to determine which one (already disabled the referrer filter for post, but this did not help)

Example of the way we are currently testing this:

<form method="POST" action="http://author.localhost.com:4502/bin/forms/post" id="test-whitelist" name="test-whitelist" enctype="multipart/form-data" class="cmp-form aem-Grid aem-Grid--12 aem-Grid--default--12">

    <input type="hidden" name=":formstart" value="/content/test/en/TestFormPost1/jcr:content/rootLayoutContainer/root/responsivegrid/container">

    <input type="hidden" name="_charset_" value="utf-8">

    <input type="hidden" name=":redirect" value="http://localhost:4502/content/test/nl.html">

    <div class="text aem-GridColumn aem-GridColumn--default--12">

<div class="cmp-form-text">

    <label for="form-text-749542657">Text input field</label>

    <input class="cmp-form-text__text" data-cmp-hook-form-text="input" type="text" id="form-text-749542657" name="text">

</div></div>

<div class="button aem-GridColumn aem-GridColumn--default--12">

<button type="SUBMIT" class="cmp-form-button">Submit</button>

</div>

</form>

   

For testing we're opening the page at: localhost:4502, posting to author.localhost.com:4502 and redirecting back to localhost:4502

When we keep the domain of the page and the action url the same, the submit works correctly.

AEM Version: 6.4.4

Nb: We're using the basic form components (i.e. not adaptive forms)

In practice we will be posting to a sub domain.

Any help is much appreciated!

1 Accepted Solution

Avatar

Correct answer by
Level 2

found the culprit: it was the Adobe Granite Cross-Origin Resource Sharing Policy (of course )

View solution in original post

2 Replies

Avatar

Correct answer by
Level 2

found the culprit: it was the Adobe Granite Cross-Origin Resource Sharing Policy (of course )

Avatar

Level 2

What are the configurations that needs to be added for Adobe Granite Cross-Origin Resource Sharing Policy , Please let me know