Sling Servlet 403 Forbidden Error | Community
Skip to main content
saibul
Level 4
September 21, 2021
Solved

Sling Servlet 403 Forbidden Error

  • September 21, 2021
  • 2 replies
  • 2803 views

AEM 6.5.5

 

We have a form and we submit the form data to a servlet using post method. We have reactjs and webpack will pack js and added to clientlibs/clientlib-base.

Previously the form submission was working fine but recently it is not working. Even we are getting the same error when we try it from our publish server w ithout via dispatcher.

 

It works well if we remove POST from FilterMethods in Adobe Granite CSRF Filter config. But we cannot remove this in our prod publish.

In some of the threads they are asking to use cq.jquery but we cannot use cq.jquery in ui.frontend project.

Is there something we can pass additionally in the request header so that the server will honor the request.

 

It will be helpful if some has solution for it. 

 

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 kchaurasiya

@saibul : Have you allowed proxy on the clientlib-base. Please check the below for the reference.

 

Thank You.

Keshav Chaurasiya

2 replies

kchaurasiya
Level 5
September 21, 2021

@saibul Can you explain in the details what the operation you are doing with servlet. It will help to understand more on this. As you said form submission was working fine previously using post method and now it is not working.

Are you using the system user in servlet to reading/update any node properties?

 

Thank You.

Keshav Chaurasiya

saibul
saibulAuthor
Level 4
September 23, 2021

@kchaurasiya thanks for your response.

No, just we collecting the values from form sending to a preconfigured email. We are not accessing any node data in the servlet.

kchaurasiya
kchaurasiyaAccepted solution
Level 5
September 23, 2021

@saibul : Have you allowed proxy on the clientlib-base. Please check the below for the reference.

 

Thank You.

Keshav Chaurasiya

Suraj_Kamdi
Community Advisor
Community Advisor
September 21, 2021
saibul
saibulAuthor
Level 4
September 23, 2021

@suraj_kamdi, Thanks for your response.. sorry it didnt help. I added granite.csrf.standalone value to both dependency as well as dependencies[] property, but no luck.