Failed to load resource: the server responded with a status of 401 (Unauthorized) /App/AngularJS/angular.min.js

我与影子孤独终老i 提交于 2019-12-03 05:27:08

When servers respond with access denied message (401 Unauthorized access), it means that the anonymous IIS user account is unable to access the resources because of permission issues.

By default, IUSR account is used for anonymous user.

All you need to do is:

IIS ->
Authentication --> Set Anonymous Authentication to Application Pool Identity.

Problem solved :)

Also I have set the read/write/modify access for "IUSR" & "IIS_IUSR" users of whole project.

this was enough for me to get around the same issue.

PS. sorry for using your image, just want to emphasize the step you mentioned that worked for me.

Assuming that you are using form authentication and you are trying to get it before login. You can use the following in your web.config file inside <configuration>.

<location path="AngularJS">
 <system.web>
  <authorization>
    <allow users="*" />
  </authorization>
</system.web>
</location>

It will make you files inside AngularJS folder available without login

Well,

It's strange but It worked. The solution was to set the default user for "Connect as" in IIS. See the image given below.

I specified the administrator user & this started to work in IIS. I think this is some kind of requirement with AngularJS to work on IIS.

Thanks for replies.

It will work when you add IUSR into the application folder security.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!