0

I'm currently working on an application that will likely be deployed amongst various organizations within my current workplace. I need to develop a testable and properly designed authentication framework so that for each implementation folks can choose to use either Windows Authentication, Forms Authentication, a home-grown Single-SignOn system OR OpenID.

So given ASP.NET MVC (and in particular I'm using the S#arp Architecture framework) how should I go about doing this?

Ideally it would be nice if folks can simply make changes to the web.config file in each case.

Thanks

1
  • what's loaded about it? deploying a solution where the particular form for authentication may vary from one install to another doesn't seem like a unique case for me. i'm sure folks have done it and i'm sure there are opinions about how it could/should be done ... and that is what i'm hoping to hear. Commented Sep 15, 2009 at 20:18

1 Answer 1

1

ASP .NET MVC supports ASP .NET membership provider, making it easier for you to handle Windows/Forms Authentication without any hassle. As long as you specify the required information on the web.config. The default site comes with an example.

For other options of implementation, Kigg has an OpenID implementation which also includes the unit testing code.

I guess that after learning how those work you'll find a way to include your "home-grown Single-SignOn" authentication framework :P

Update:

In order to use the membership provider using your own users table, you must implement a custom provider. The configuration through the web.config will be available anyways, but you'll need to create a class which implements the MembershipProvider abstract class.

Here's a link to a video and some source code explaining how to achieve this.

Sign up to request clarification or add additional context in comments.

3 Comments

Agreed. We use Active Directory for authentication and Authorization Manager for role membership. All that was really necessary in MVC was to configure web.config to use those. I just did a quick search and here is a blog entry on using Active Directory for Authentication. You can use it as an example for other types of authentication. helios.ca/2009/05/04/…
Thanks for the response but it really doesn't answer my question. The database for this application will need to have its own users table in order to support any of the modes of authentication specified above. The question is how best to accomplish this.
The Membership provider supports custom data sources. You would have to implement a class which implements the membership provider's abstract class.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.