2

I am working on a SharePoint Framework based project in SharePoint Online and using React JS as front-end library. I am also using Redux for state management and React Hooks. I want to know how can I implement server-side validation in SharePoint Framework (with react JS), although I have already implemented client-side validations on the forms/components and on all the mandatory fields.

However, in the security testing of the application, it has been reported as an issue that there should be strict server-side validation in the fields - For Eg. - file types validation, file extension. Additionally, the application should implement strict server-side validation against all the mandatory fields in all the application forms / registration pages of the application.

Please suggest how can I achieve this.

Your early response would be highly appreciable, thanks in advance.

1 Answer 1

4

SharePoint Framework does not support server-side validation directly. SPFx is purely clident-side. That being said, we can always make business critical SPFx apps more secure by offloading the logic away from SPFx.

Options

I think it's an overkill for the 99% of cases, but these are the options for including the server-side validation:

  1. [Recommended] Create an Azure function and call it from your SPFx solution. Azure function will contain the validation code.
  2. Create a provider-hosted SharePoint app instead of SPFx.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.