ASP.NET: Sharing Resources (Membership, Libraries) Between Web Applications

I am trying to create a small intranet. For this I have a web server on my local machine. The root of this website will be the control panel and will contain the login / registration functionality (default ASP.NET membership).

http: // localhost
http: // localhost / Account

The rest of the intranet will consist of sub-applications such as:

http: // localhost / ApplicationName

The root website and most of the sub-applications will need user authentication for which I will use the default ASP.NET membership provider.

All projects (root and sub) are separate projects in Visual Studio and each project has its own WebSetup project to deploy.

1.) How can I use ASP.NET membership in sub-applications?

Also, most applications (root and sub) will use a third party library (data infrastructure).

2.) How can I link to a library in the root project and "use" the referenced library in sub-applications?

Thanks for any suggestions!

0


source to share


2 answers


Build your shared code in class library projects that can be used from multiple web projects. As for the membership provider, I think you will need to store the membership data in an external SQL instance (which could be on the same server) and then just use the same connection strings to access it in every project.



+2


source


Membership is designed to work with one or more applications. You can have a database instance (separate from any databases for any of your applications) that can host each of your membership data. If you want all of your applications to use the same membership information, specify the same application name (and connectionString) when defining the membership in each application web.config .

Regarding the second part of your question, tvanfosson's answer (along with the comments) should get you on the right track.



Edit (@ropstah comment): Oh, I didn't explain it. In this case, you want to implement Single Sign-on (SSO) . Masoud Tabatabaei posted an article on ASPAlliance.com that is going through the process. Also, the answer provided by Keith Rull to this question might help as well.

+1


source







All Articles