开发者

authenticate file in _layouts folder

I have a public facing website www.abcd.com .. I have adde开发者_JAVA技巧d a file "Authenticated.html" in _layouts folder of it. so now when user is going to this url

www.abcd.com/_layouts/authenitcated.html ... one can see all the content in it. I want this particular file to be only shown to authenticated users and asks for authentication. If there is any way i can achieve this?


Here is a couple of alternatives:

Put the following into _layouts/web.config:

<location path="Authenticated.html">
  <system.web>
    <authorization>
      <deny users="?"/>
    </authorization>
  </system.web>
</location>

Or as I'd prefer change your extension from html to aspx and put these two lines at the top:

<%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
<%@page Inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase" %>


Alrite I figure it out...go to IIS select the web application you want...go to the file in _layouts folder you want to authenticate ->properties->File Security->uncheck anonymous access...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜