Base solution for your next web application
Open Closed

How to implement custom membership provider #3035


User avatar
0
rev319303 created

I downloaded BoilerPlates's ASP.Net Core 1.x project without module zero.

I am creating a web application for intranet use only. The company already has a custom membership provider that, in the past, they have implemented in the web.config as such:

<membership defaultProvider="NCMProvider">
    <providers>
        <clear />
        <add name="NCMProvider" type="Netcenter.NetcenterMembershipProvider" description="..." connectionStringName"..." enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" applicationName="..." />
    </providers>
</membership>

<roleManager enabled="true" defaultProvdier="NCRProvider">
    <providers>
        <clear />
        <add name="NCRProvider" type="NetCenter.NetCenterRoleProvider" connectionStringName="..." applicationName="..." />
    </providers>
</roleManager>

They also have a Netcenter.dll reference in their projects. They do security by calling this:

Using System.Web.Security
Roles.IsUserInRole("...")

It is required that all security go through their Netcenter. Netcenter simply has a list of applications with roles and user assigned to roles by Windows NT (Domain + "/" + ThreeCharacterString). Their Netcenter dll has everything to check access. I simply need to write something like this:

string userNt = HttpContext.User.Identity.Name;
if(Roles.IsUserInRole(userNt) { }

Can anyone provide help on how to implement this within a BoilerPlate project without Module Zero?


3 Answer(s)
  • User Avatar
    0
    alirizaadiyahsi created

    Hi,

    Actually, this question is not directly related with ABP. This topic is mostly related to .net technologies.

    This link can give you an idea <a class="postlink" href="http://stackoverflow.com/questions/33758823/using-the-old-aspnet-membership-with-aspnet-vnext">http://stackoverflow.com/questions/3375 ... pnet-vnext</a>

  • User Avatar
    0
    rev319303 created

    Thank-You for your response.

    Let me rephrase because now that I have researched for a while, I think I can better ask my question. The companies netcenter security simply stores a users 3 character windows nt account tied to a role tied to an application in a separate database. I simply need to know how to extend ABP's IAbpSession to include a user's windows nt or how to pass/get a hold of the user's NT through the many layers of the application? For example, if I make an ajax call to my app service then how do I get a hold of the user's NT?

    I'm still a young developer and realize this answer is probably on StackOverflow but I haven't been able to find it. I'm just not sure whether to extend IAbpSession or Cookie or Asp.Net Session or ...?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you check this answer here #1725@ecf150a8-ddb4-4bf8-baf9-d8288d9796a2 ? It seems like it is suitable for your case.