Custom .Net MemberhipProvider in n-level environment?

I am working on splitting an existing working application that I have in order to better understand n-level structures. This application uses custom membership providers and forms authentication roles.

All data access and business logic are part of the same ASP.Net solution.

I built a Business Logic Layer (BLL) and a Data Access Layer (DAL), and I am extracting business logic. I am afraid where MembershipProvider classes should exist.

  • Do membership provider classes need to live at the presentation level due to the tight connection of the built-in user interface controls (logon, create user wizard, etc.) that use these classes?

  • Can they exist in BLL? If so, how can I refer to them from the presentation? Is it just a matter of changing web.config to point to BLL.membershipprovider after the BLL link to the user interface?

Just trying to find a sanity check before going the wrong way. Unfortunately, I could not find any examples of this through Google. Any hints / pointers appreciated.

+4
source share
2 answers

Membership classes can exist in any referenced assembly. Just make sure you fully define the namespace and class names in the configuration.

+1
source

The web.config keys for node membership / providers allow you to specify a custom type, so with the appropriate namespace and assembly reference in this key, you can put your custom membership objects anywhere you want. I would suggest a separate DLL for membership logic (objects that inherit the base membership classes) that references your BLL for all of the internal authentication logic.

http://msdn.microsoft.com/en-us/library/aa479048.aspx

+4
source

All Articles