AEM: Recommended approach for performing POST request to AEM >=6.2 | Community
Skip to main content
Level 4
June 26, 2018
Solved

AEM: Recommended approach for performing POST request to AEM >=6.2

  • June 26, 2018
  • 4 replies
  • 6721 views

Hello Guys, I have been searching all the forums and blogs to find out the recommended approach for implementing an http post request to my website on AEM publish instances. (Mine is a public site and there is no login feature)

Note: This is for a production instance and I don't want to rely on jquery.

Can you please suggest the approach that  I should follow in below scenarios.

1. Initiate a server to server post request (from external server to AEM server)

2. Initiate a post request from client (say a form submission on the website)

Appreciate your help here.

Regards,

Anand MN

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Hi,

If you do server to server POST call, which makes it more secure than making POST call from client.

But in AEM 'Apache Sling Referrer Filter' configuration make sure the type of request which are allowed from particular domain, so AEM provide one more layer of security. So if you can go for client as well otherwise server side Post call is always advisable if traffic is less otherwise server load will be increased.

Referrer Filter settings

4 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
June 26, 2018

Hi,

If you do server to server POST call, which makes it more secure than making POST call from client.

But in AEM 'Apache Sling Referrer Filter' configuration make sure the type of request which are allowed from particular domain, so AEM provide one more layer of security. So if you can go for client as well otherwise server side Post call is always advisable if traffic is less otherwise server load will be increased.

Referrer Filter settings

Arun Patidar
smacdonald2008
Level 10
June 26, 2018

Excellent response!

a_mn1Author
Level 4
December 19, 2018

Dear Arun, To be honest , I doubt if this has answered my question. How will you tackle the CSRF token filter issue here ?

Let me tell you how I have solved my issue.

1. In the "Adobe Grantite CSRF Filter", add my servlet to the exclusion list.

2. Check the Allow Empty in the "Apache Sling Referrer Filter".

With the above 2 changes my post request are working in both scenarios.

Now my doubt is , is this a recommened approach for doing POST request in a production publish instance.  How can I have an integration between a non aem system and AEM with POST.

a_mn1Author
Level 4
December 19, 2018