我正在向我用 ASP.NET 核心编写的公司应用程序添加对 Extranet 用户的支持,并使用以下库:EnterpriseLibrary.Security.AzMan 5.0。需要注意的是,这是迁移已实现此认证/授权的现有 ASP.NET 2.0 Web 表单应用程序的一部分。
Web表单应用程序使用的xml配置如下:
<membership defaultProvider="AspNetActiveDirectoryMembershipProvider">
<providers>
<add name="AspNetActiveDirectoryMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider"
connectionStringName="DirectoryConnection" connectionProtection="Secure"
enableSearchMethods="true" requiresUniqueEmail="true"
attributeMapUsername="sAMAccountName" description="Default AD connection"
clientSearchTimeout="30" serverSearchTimeout="30" />
</providers>
</membership>
使用 ASP.NET Core,我需要使用依赖注入添加此服务。我需要将以上内容转换为 json,这是 ASP.NET CORE 的配置格式。
我现在将以下内容添加到 appSettings.json:
"AzMan": {
"defaultProvider": "AspNetActiveDirectoryMembershipProvide",
"providers": {
"name": "AspNetActiveDirectoryMembershipProvider",
"type": "System.Web.Security.ActiveDirectoryMembershipProvider",
"connectionStringName": "DirectoryConnection",
"connectionProtection": "Secure",
"enableSearchMethods": "true",
"requiresUniqueEmail": "true",
"attributeMapUsername": "sAMAccountName",
"description": "Default AD connection",
"clientSearchTimeout": "30",
"serverSearchTimeout": "30"
}
有人可以建议通过启动类添加此服务的步骤。?
非常感谢提前伯特兰