When your CSOM scripts in SharePoint 2013 fails with the error message "The remote server returned an error: (401) Unauthorized."
The resolution is to add new settings in web.config of your web application.
<appSettings>
<add key="aspnet:AllowAnonymousImpersonation" value="false" />
</appSettings>
<add key="aspnet:AllowAnonymousImpersonation" value="false" />
</appSettings>
Happy SharePointing :-)

vishnu jalagamPosted Feb 15, 2017, 11:16 AM
I am updating data in SharePoint online via Console Application.Where do I need to add above setting ??