Sharepoint 2016 配置FBA(二) 编辑Web,config文件
使FBA生效,下一步在Sharepoint中设置Membership Provider,一个Membership Provider是一个从程序到任证库(credential store)的接口。这样允许同一个程序工作在多种不同的存储认证。举例来说,可以使用LDAPMembership在Active Directory上认证或者SQLMembershipProvider在SQL Server上认证。这个例子使用的是Sql Server
修改任何.config文件前,备份一下。
备份然后打开web.config。
在</SharePoint>和<system.web>之间<connectionStrings></connectionStrings> 节, 增加一行,Server需要改成实际的服务器名。
<add connectionString="Server=win-h472cerv001;Database=aspnetdb;Integrated Security=true" name="FBADB" />

在 <membership><providers> 节,增加一下配置
<add name="FBAMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="FBADB"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
applicationName="/"
requiresUniqueEmail="true"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
可以自定义每个选项,最重要的是,如果多处的MembershipProvider使用同一个数据库,它们的配置必须相同。否则会出现各种问题,在创建用户时是一些配置,在用户登录时是另一些不同的配置。
| Option | Description |
|---|---|
| connectionStringName | The name of the database connection to the aspnetdb database. |
| enablePasswordRetrieval | true/false. Whether the user’s password can be retrieved. I suggest setting this to false for security purposes. |
| enablePasswordReset | true/false. Whether the user can reset their password. I suggest setting this to true. |
| requiresQuestionAndAnswer | true/false. Whether accounts also have a question and answer associated with them. The answer must be provided when resetting the password. I suggest setting this to false, as setting it to true prevents an administrator from resetting the user’s password. |
| applicationName | Setting the application name allows you to share a single membership database with multiple different applications, with each having their own distinct set of users. The default applicationName is /. |
| requiresUniqueEmail | true/false. Determines if multiple users can share the same email address. I suggest setting this to false, in case you ever want to implement a login by email system. |
| passwordFormat | Clear, Hashed or Encrypted. Clear stores the password in the database as plain text, so anybody with access to the database can read the user’s password. Encrypted encrypts the user’s password, so although the password isn’t human readable in the database, it can still be decrypted and the user’s actual password retrieved. Hashed stores a one way hash of the password. When a user authenticates, the password they enter is hashed as well and matched against the stored hashed value. Using this method, the user’s password can never be retrieved (even if your database is stolen), only reset. I always recommend using “Hashed” as it is the most secure way of storing the user’s password. |
| maxInvalidPasswordAttempts | The number of times in a row that a user can enter an invalid password, within the passwordAttemptWindow, before the user’s account is locked out. Defaults to 5. |
| passwordAttemptWindow | The number of minutes before the invalid password counter is reset. Defaults to 10. |
| minRequiredPasswordLength | The minimum password length. Defaults to 7. |
| minRequiredNonalphanumericCharacters | The minimum number of non-alphanumeric characters required in the password. Defaults to 1. |
| passwordStrengthRegularExpression | A regular expression that can be used to validate the complexity of the password. |

在 <roleManager><providers> 节:
<add name="FBARoleProvider" connectionStringName="FBADB" applicationName="/"
type="System.Web.Security.SqlRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Sharepoint Central Administration和SecurityTokenService也需要配置,在IIS中找到Sharepoint Web Services,点开,确认 SecurityTokenService的Web.config的位置。

在</configuration>前,粘贴以下内容
<system.web>
<membership>
<providers>
<add name="FBAMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="FBADB"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
applicationName="/"
requiresUniqueEmail="true"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
</providers>
</membership>
<roleManager>
<providers>
<add name="FBARoleProvider" connectionStringName="FBADB" applicationName="/"
type="System.Web.Security.SqlRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
</system.web>
保存web.config。
Sharepoint 2016 配置FBA(二) 编辑Web,config文件的更多相关文章
- Sharepoint 2016 配置FBA(三)配置Sharepoint
编辑已经创建好的Web Applicaiton, SharePoint Central Administration -> Application Management -> Manage ...
- Sharepoint 2016 配置FBA(四)添加用户到Membership数据库
现在还不能用FBA登录,因为数据库还没有用户. 有一些方法来管理membership数据库,有可以用IIS来管理.推荐使用 SharePoint 2016 FBA Pack(https://share ...
- Sharepoint 2016 配置FBA(一) 创建Membership数据库
在Sharepoint 2016上配置FBA(forms based authentication)的过程和Sharepoint 2013一样. 第一步:创建Membership数据库. 为了存放所有 ...
- 一步步开发自己的博客 .NET版(11、Web.config文件的读取和修改)
Web.config的读取 对于Web.config的读取大家都很属性了.平时我们用得比较多的就是appSettings节点下配置.如: 我们对应的代码是: = ConfigurationManage ...
- SharePoint 2016 配置工作流环境
前言 SharePoint 2016 默认创建工作流的时候,工作流平台只包含2010版本,如果想要使用状态机工作流,需要单独安装workflow manager 1.0才可以,下面,我们为大家介绍一下 ...
- IOC注入框架——Unity中Web.Config文件的配置与调用
Unity 应用程序块可以从 XML 配置文件中读取配置信息.配置文件可以是 Windows Forms 应用程序的 App.config 或者 ASP.NET 应用程序的 Web.config.当然 ...
- Unity中Web.Config文件的配置与调用
在上一篇文章“Unit简单依赖注入”我们可以实现构造对象和被依赖对象之间的 松耦合,使我们的抽象层(Player)能够保持稳定,但是在并没有把客户类和Player类之间彻底解耦,即当我们不想使用MP3 ...
- 跨域Ajax请求 web.config文件配置
在web.config文件的<system.webServer>节点下面添加如下配置代码:<!--允许跨域ajax访问--> <httpProtocol> < ...
- web.config文件中配置数据库连接的两种方式
web.config文件中配置数据库连接的两种方式 标签: 数据库webconfig 2015-04-28 18:18 31590人阅读 评论(1)收藏举报 分类: 数据库(74) 在网站开发 ...
随机推荐
- 容器虚拟网卡与网桥docker0虚拟网卡的veth pair的配对
一)基本知识: Docker 安装时会自动在 host 上创建三个网络:none,host,和bridge:详细说明可参考其它文档.我们可用 docker network ls 命令查看: 基于DRI ...
- C++ for循环语句
#include "pch.h" #include<iostream> using namespace std; int main() { int i = 1, sum ...
- linux php7.2安装扩展memcached
wget http://pecl.php.net/get/igbinary-2.0.8.tgz tar -xzvf igbinary-2.0.8.tgz cd igbinary-2.0.8 /usr/ ...
- linux php5.6 安装扩展 memcached
wget http://pecl.php.net/get/igbinary-1.1.1.tgz tar -xzvf igbinary-.tgz cd igbinary- /usr/local/php5 ...
- riakKV 配置
安装好riakKV之后, 我们需要将 riak.conf 文件中的 nodename修改为本机的 IP 地址. nodename = xx@xxx.xxx.xx.xx listener.http.in ...
- 【Beta】Scrum Meeting 1
前言 会议定点:新主楼F座教室 会议时间:2019/4/26 会议目的:确定Beta版本的功能和设计文档 一.任务进度 组员 下阶段任务 大娃 后端模型正确性说明文档 二娃 记录会议内容,撰写博客 三 ...
- 浅谈Object.assign()
Object.assign()方法用于将所有可枚举属性的值从一个或多个源对象复制到目标对象.返回值为目标对象. 1 Object.assign 是 ES6 新添加的接口,主要的用途是用来合并多个 Ja ...
- Android串口屏(电阻,电容触摸),带AV输入,7寸LCD1(800*48...
基本参数:CPU:MT6572 双核1GHzRAM:512MB存储:4GB网络:GSM,WCDMA(BAND1)WIFI:2.4G 802.11bgn蓝牙:2.0支持GPS定位 扩展参数:1.电源输入 ...
- LeetCode 98 验证二叉搜索树
题目: 给定一个二叉树,判断其是否是一个有效的二叉搜索树. 假设一个二叉搜索树具有如下特征: 节点的左子树只包含小于当前节点的数. 节点的右子树只包含大于当前节点的数. 所有左子树和右子树自身必须也是 ...
- ansible资产配置
参考链接:https://www.cnblogs.com/iois/p/6403761.html ansible主机组的使用,我们在对一个集群进行管理的时候集群会有很多角色,在执行统一命令操作的时候我 ...