Any authentication and authorization framework for a Windows Form application?

I am a C # developer. I am developing both Windows and web applications. I would like to create a roleform based Winforms application. All users must have a role / group (s). Then we assign permissions like "View, Add, Update, .." to the role / group. The role / group is dynamic, so we allow users to define it.

Are there any frameworks and good examples of projects for its implementation?

+7
authentication c # authorization winforms
source share
4 answers

I usually run my own, as the .NET Framework is pretty full featured in this regard, but you can try MS Authorization and Profile Application Block .

+1
source share

As for the detailed implementation details, have you looked at the "directors"? See my answer here . With this approach, you can use role-based security in code, for example:

[PrincipalPermission(SecurityAction.Demand, Role="ADMIN")] static void SomeMethod() {...} 

The runtime itself will verify that the user must have their own "ADMIN" role to access this method (obviously, you can also disable the option in the user interface by checking IsInRole(...) ). Very powerful.

+1
source share

If you're not too keen on reinventing the wheel, take a look at a product called Visual Guard . This allows you to easily add security to your application with minimal work and has a truly full-featured toolkit.

+1
source share

If you are already familiar with ASP.NET, you are probably familiar with the ASP.NET Membership / Role / Profile system, the default providers, and the ability to add your own without too much trouble.

Wouldn't it be great if you could use all of this from your Windows Forms or WPF applications? Yes? Ok, then take a look at ASP.NET Application Services ! You simply set up a website to provide an authentication URL, and then ask it to use it. You can create your own login window and open applications when necessary, or use your own logic and call methods yourself.

It has full support for "offline mode", in which it caches the password hash for comparison, it can also cache roles and allows you to use profile settings.

+1
source share

All Articles