AEM adaptive forms rest service test return unauthorized | Community
Skip to main content
vikramca06
Level 4
June 26, 2020
Solved

AEM adaptive forms rest service test return unauthorized

  • June 26, 2020
  • 2 replies
  • 3495 views

Hi All,

 

I am trying to integrate REST API with adaptive form using form data model. My REST api doesn't have any authentication but i get below error when i test the connection.

 

{
"errorCode": "AEM-FDM-001-016",
"errorMessage": "Error occurred while invoking the service.",
"originCode": "500",
"originMessage": "Unauthorized request"
}

 

My swagger file is good and i am able to see all the fields extracted from swagger.

 

Did anyone faced the same issue? let me know if there any solution for this or need to raise daycare ticket.

 

Thanks,

Vikram.

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 vanegi

Can you please refer to the link below for the same:

https://docs.adobe.com/content/help/en/experience-manager-learn/forms/handling-af-form-submissions/s....

 

2 replies

vanegi
Adobe Employee
vanegiAdobe EmployeeAccepted solution
Adobe Employee
July 11, 2020
dkumar_gobi
Level 2
March 1, 2023

Bit late but might help other people who are setting up forms.

Root cause 

1) The Form Data Model will use authentication mechanism Configured in AEM  cloudservices/datasource. If you have selected no authentication during setup - it will use anonymous user.  In Author env - anonymous user is restricted cannot read /content . so code will throw unauthorsied access. (Developer might get tricked if he/she thinks his logged in ID is used in FDM ).

Solution

1) Configure authentication settings in AEM cloudservices datasource. Make sure that user has all rights needed to call the API and read content etc .

2) Configure logs for DermisServlet and other forms code to debug it

kautuk_sahni
Community Manager
Community Manager
March 2, 2023

@dkumar_gobi Thank you for sharing this with Community. 

Kautuk Sahni