0

I'm adding support for extranet users to my corporate application written in ASP.NET core and using the following library: EnterpriseLibrary.Security.AzMan 5.0. It is important to note that this is part of migrating an existing ASP.NET 2.0 web form application where this athentication/Authorisation was implemented.

The xml configuration used with web form application is as follow:

<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>

With ASP.NET Core i need to add this service using dependancy injection. I need to convert the above to json which is the configuration format for ASP.NET CORE.

I now added the following to 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"

}

Can someone suggest the steps to follow for adding this service via the startup class. ?

Many thanks in advance Bertrand

Steven
  • 166,672
  • 24
  • 332
  • 435
Bertrand Paul
  • 97
  • 2
  • 9
  • I'm almost certain that you can't use anything that uses `System.Web.*` namespace in ASP.NET Core, as everything which used it was tightly coupled to IIS and http.sys and unless you change change the constrcutor (by inheriting or modifying the code of the original class), you can't inject the settings neither via DI – Tseng Oct 05 '16 at 23:32
  • I'm using the full Framework with ASP.NET CORE 1.0! – Bertrand Paul Oct 07 '16 at 07:47

0 Answers0