views:

39

answers:

1

We have a simple ASP.NET app that uses the ASP.NET SqlMembershipProvider and all is great.

We want to create a second app on the same server, also use the SqlMembershipProvider, but a different "applicationName" so that the user accounts between the two apps are kept separate.

It looks like this would be possible by making the two different app domains (ie they each have their own web.config), but I'm hoping to just put them in different directories so I don't have 3 web.configs (one for each app, and the main one) that all have to be kept synchronized. So what I'm after is:

/web.config
/APP1 (uses membership provider in /web.config, with userlist A)
/APP2 (uses membership provider in /web.config, with userlist B)

It looks simple to define multiple membership providers that use a different 'applicationName' value.

But how do you tell the system.web.authentication node which membership provider to use?

As far as I can figure, it will always use the default.

A: 

Using your structure I think you'd have to implement your own wrapper around the Membership provider, effectively creating your own provider that just shims the requests and modifies the appname value based on the apps directory.

Lazarus