views:

61

answers:

2

Hello,

We have an ASP.net application but some screens are deemed too slow to use by our users. As a result, we are trying to provide a WinForms-based alternative to those data-input centric screens so we can use richer controls like Grids with immediate screen updates and feedback for the user.

Ideally, I would like the users to login to the WinForms application using the same credentials they use in the ASP.net application?

Is it possible? I've found this post ( http://stackoverflow.com/questions/1172069/net-authentication-for-both-web-and-winforms ) but it isn't really answering the question from my point of view... We are not using WebServices, or WCF at the moment and do not plan to use it unless it is really the only way to achieve this.

Thanks a lot.

+3  A: 

Sure you can, just add the same settings in your app.config that you have in your web.config to wire up the Membership provider, and reference System.Web.Security. Then you can use Membership and Roles from your WinForms application.

See this article for a good example of how to do this: http://www.theproblemsolver.nl/usingthemembershipproviderinwinforms.htm

Per-Frode Pedersen
Thanks everyone. I tried this on a demo project and it worked great!
Kharlos Dominguez
+2  A: 

Take a look at this article: Unify Windows Forms and ASP.NET Providers for Credentials Management.

For even more information check out the links from this answer: http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/9e5192f4-4f44-4db6-aab8-8e79f2e667f8.

XIII