国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
在SharePoint 2010中使用表單認證
在SharePoint 2010中使用表單認證

在WSS 3.0或MOSS 2007中如果要同時使用Windows集成認證和窗體認證,必須擴展已有的Web Application到另一個端口,然后為不同的區(qū)域各自選擇認證方式。這是個不錯的方案,但仍然有以下問題,

  • 兩者本質上是兩個獨立的網站,依賴于同一個內容數(shù)據(jù)據(jù)。一些自定義內容需要被部署兩次,例如自定義Web Part。
  • 兩者的URL不同

SharePoint 2010基于聲明的混合認證方式,解決了以上問題。

使用AspNetSqlMembershipProvider設置聲明認證

為SharePoint 2010設置AspNetSqlMembership窗體認證的主要步驟與SharePoint 3.0相似。本文在不同之處會重點指出。

配置AspNetMembershipProvider

先使用aspnet_regsql這個工具創(chuàng)建用于Asp.Net Membership認證的數(shù)據(jù)庫,可取名為aspnetdb。

使用Visual Studio創(chuàng)建一個網站,便于在該網站的配置文件中設置提供程序。
設置<authentication mode="Forms" />,以使用窗體認證。
在web.config添加連接字符串。

<connectionStrings>
  <add connectionString="Server=localhost;Database=aspnetdb;Integrated Security=true" name="MyAspNetDB" providerName="System.Data.SqlClient" />
</connectionStrings>

在<system.web>節(jié)點下添加Memebership定義。

這里都顯式定義了連接字符串、membership和roleManager,而不是使用默認的AspNetSqlMembershipProvider定義。這是為了在后面SharePoint的設置中使用相同配置。

在Visual Studio中選擇菜單網站->ASP.Net配置,檢查設置是否正確,并添加用于測試的用戶和角色。

創(chuàng)建SharePoint 2010 Web應用程序

在SharePoint 2010的管理中心新建Web應用程序。(Vista/Win7/Windows 2008下必須以管理員身份運行IE才能在管理中心創(chuàng)建Web應用程序)


此處,必須選擇“基于聲明的身份驗證”才能使用基于窗體的身份認證。這與SharePoint 3.0不同。如果在這里選擇了“經典模式身份認證”,SharePoint 2010仍然會允許擴展Web應用程序并設置不同的區(qū)域,但是在區(qū)域的安全性設置中,無法設置窗體認證。
選中“啟用基于窗體的身份驗證”,并在下方的文本框中輸入在上面步驟中設置的Membership提供程序和角色管理器名稱。

設置SharePoint 2010管理中心網站web.config

打開管理中心網站的web.config。將上面步驟中的ConnectionString, Membership和RoleManager全部復制到管理中心web.config中對應位置。
并在PeoplePickerWildcards中添加所定義的MyAspNetMembers提供程序。

<PeoplePickerWildcards>
<clear />
<add key="AspNetSqlMembershipProvider" value="%" />
<add key="MyAspNetMembers" value="%" />
</PeoplePickerWildcards>

設置新建Web應用程序的web.config

將上面步驟中的ConnectionString, Membership和RoleManager設置添加到新建web應用程序的web.config對應位置中。注意保留其中已有的提供程序與默認值。

<membership defaultProvider="i">
<providers>
<add name="i" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<add connectionStringName="MyAspNetDB"
applicationName
="/"
name
="MyAspNetMembers"
type
="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
<roleManager defaultProvider="c" enabled="true" cacheRolesInCookie="false">
<providers>
<add name="c" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<add connectionStringName="MyAspNetDB"
applicationName
="/"
name
="MyAspNetRoles"
type
="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</roleManager>

設置Security Token Service(STS)的web.config

SharePoint 2010是通過STS驗證用戶聲明的,為了讓STS能進行正確的驗證,必須在STS的web.config中配置同樣的提供程序。
STS工具的路徑為C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\WebServices\SecurityToken。

打開其web.config,添加配置如下。

<system.web>
<membership>
<providers>
<add connectionStringName="MyAspNetDB"
applicationName
="/"
name
="MyAspNetMembers"
type
="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>

<roleManager>
<providers>
<add connectionStringName="MyAspNetDB"
applicationName
="/"
name
="MyAspNetRoles"
type
="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</roleManager>
</system.web>
<connectionStrings>
<add connectionString="Server=localhost;Database=aspnetdb;Integrated Security=true" name="MyAspNetDB" providerName="System.Data.SqlClient" />
</connectionStrings>

其中,不需要為membership或roleManager設置默認的提供程序。

創(chuàng)建網站集并設置用戶

一切配置就緒后,就可以為新建的Web應用程序創(chuàng)建網站集并設置用戶。如圖,administrator為Windows用戶,stanley為基于ASP.Net Membership的窗體認證用戶。


點擊“瀏覽”圖標可以查找到Windows認證和窗體認證的用戶。

本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
SqlMembershipProvider的配置
通過configSource提高web.config配置靈活性
SharePoint 表單認證創(chuàng)建用戶
C#獲取web.config配置文件內容
asp.net2.0中讀取web.config數(shù)據(jù)庫連接字符串2種方法
ASP.NET MVC 5 學習教程:創(chuàng)建連接字符串
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服