Implement IPrincipal project in winforms

I am trying to implement authorization and authentication in my current winforms project. Authentication must also match the user in the SQL Server 2008 database. The fact is that this is a multi-user program, so when a new user is added, a database is created and the user ID is added to the database.

I wondered if it is possible to implement IPrincipal and IIdentity. So far, I have only found ASP.NET implementations.

Can someone give me some tips on what is the best way to implement password / user security in a winforms application? Remember that it must be checked using a database in SQL Server.

A value for the database must exist for this user, and their credentials must be correct.

+3
source share
1 answer

You can implement your own object IPrincipalby writing a class that implements this interface.

Since you are going to use another source that Windows provides username and password, you will also need to write your own implementation IIdentity.

Fortunately, these are not great interfaces.

IIdentity, , SQL 2008. , , "" , IsInRole(string roleName) .

, Winforms, ASP.NET

UPDATE

, ( ), , "" .

.

+7

Source: https://habr.com/ru/post/1726122/


All Articles