3

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 ( .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.

6
  • The membership / user data are 'just tables'. So you could use similar connectionstrings (/providers) (if your db security is setup to allow this). Also have a look here, if you like: code-magazine.com/Article.aspx?quickid=0511031 Commented Aug 9, 2010 at 11:32
  • Can you please expand on this? As far as I know, the passwords are hashed etc and I don't know how so I can't compare my password against them? Commented Aug 9, 2010 at 11:35
  • Have a look here as well. msmvps.com/blogs/theproblemsolver/archive/2006/01/12/80905.aspx I'd imagine (but I'm not sure) the passwords would 'just work' for their owners as you'd expect. Commented Aug 9, 2010 at 11:38
  • The missing piece: How do you login to your ASP.NET? Windows authentication or Forms? Commented Aug 9, 2010 at 11:39
  • Not Windows Authentication. standard ASP.net memberships user accounts. Commented Aug 9, 2010 at 11:41

2 Answers 2

3

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

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

1 Comment

Thanks everyone. I tried this on a demo project and it worked great!
2

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.

Comments

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.