偷瓜的贼 发表于 2015-9-28 14:00:43

配置SharePoint站点的域认证和表单认证双重认证2/2

  在上一篇文章中,我们已经初步完成了SharePoint的配置工作,分别将FORM认证网站http://www.sharepoint.org.cn 和管理中心网站的WEB.CONFIG文件进行修改。
  并在管理中心中修改了http://www.sharepoint.org.cn 的认证模式,在本篇文章中,我们将在该站点下创建一个网友自注册的站点。
  由于已经在http://www.sharepoint.CN 下已经有一个form认证虚拟目录,故下面在一个新的匿名访问站点下开始创建工作。
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint1.png
  右建点击站点,点击新建"虚拟目录"。
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint2.png
  输入虚拟目录的名称后,在E盘新建一个目录,命名为membership。
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint3.png
  打开相应的权限
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint4.png
  开启VS2005,点击打开-网站;
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint5.png
  选择该站点下的虚拟目录,点击打开。
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint6.png
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint7.png
  新建配置文件,点击添加。
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint8.png
  添加上篇文章中的三个xml节内容;注意数据库的名字;
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint9.png
  右建站点,点击"添加新项"
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint10.png
  点击"Web 窗体",语言选择Visual C#,点击添加。
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint11.png
  在"设计"模式下,点击工具箱,选中"Login"控件,拖拽到窗口松开;
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint12.png
  使用同样的方法新建一个reg.aspx文件,将CreatUserWizard控件拖拽到窗口松开。
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint13.png
  双击页面,使得可以在CreatUser事件中添加代码;
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint14.png
  在相应的文件中添加如下代码:
  
  Roles.AddUserToRole(CreateUserWizard1.UserName, "Members");
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint15.png
  点击菜单,选择ASP.NET配置
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint16.png
  点击安全选项卡
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint17.png
  如出现上述情况,请检查站点的web.config文件中上述三个xml内容是否正确;
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint18.png
  选择"安全"选项卡
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint19.png
  选择创建或管理角色http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint20.png
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint21.png
  点击"提供程序"选项卡中的测试
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint22.png
  如一切顺利,则大功告成啦!
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint23.png
  在IE中打开子站点下的membership虚拟目录,能顺利访问该虚拟目录
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint24.png
  能打开REG.ASPX页面。
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint25.png
  输入相应的字段后,点击"创建用户",即提示创建成功
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint26.png
  再次打开网站管理中的"安全"选项卡,可以看到1234已经自动添加到members角色中。
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint27.png
http://www.sharepoint.org.cn/Lists/Photos/041707_1235_SharePoint28.png
  可以看到该用户已经成功登录啦!
  ENJOY!!!
  由于本人经验不够丰富,加之时间有限,以上内容只作为参考使用,在不同的环境下,可能会有不同的结果,如有疑问,可以给我留言或电子邮件。
  MSN:RUNWA@HOTMAIL.COM
  QQ:24624966
  参考文献:

[*]易联工作室《一步一步SharePoint 2007》
[*]《HowToConfigPublishingSiteWithDualAuthProvidersAndAnonAccess.aspx》地址:http://www.andrewconnell.com/blog/articles/HowToConfigPublishingSiteWithDualAuthProvidersAndAnonAccess.aspx
  转载:http://www.cnblogs.com/joshyzj/archive/2007/02/28/660184.html

[*]网友 《Project Server 2007 Form Authentication Configuration Description》
页: [1]
查看完整版本: 配置SharePoint站点的域认证和表单认证双重认证2/2