Skip to main content

Posts

Showing posts with the label Authorization

Authenticating and Authorizing in .Net

Namespace: System.Security.Principal Authenticating is the process of checking a user’s identity. Authorization means verifying user’s right to access the resources according to his identity. Usually authorization happens after authentication . Integrate system with Active Directory using WindowsIdentity and WindowsPrincipal . For straight-forward database, use GenericIdentity and GenericPrincipal . For a better control over user and roles implement IIdentity and IPrinciapl . WindowsIdentity Class : This class represents a windows account, along with user name and authentication code. Instance of WindowsIdentity can be created using: 1.        GetAnonymous : Returns WindowsIdentity Object of an unauthenticated user, which is used to insure that your code runs successfully. 2.        GetCurrent : Returns WindowsIdentity that represents the current logged in user. 3.    ...