CheckAcess Help

Jul 20, 2009 at 8:14 AM

Hi ,

Please I have question ,

I have wcf Service a wrapper over Netsqlazman , I need to check access for users only by sending user name of the user, i am just have a list of users in my application,

this users may be DB user or Windows user (i use membership), I can check on db user by sending user name to getdbuser and check access ,

but i can't understand how to check on windows user , all the samlpes use currentidentity  how i can get windows identity ? I am confused about this

what i need to make is checkAccesss method in my service that take the user name, and if save users in db check with netsqlazman on db users , or AD (windows user ) check according this users

your help appreciated


Jul 21, 2009 at 7:43 AM


the WCF Service NetSqlAzMan Cache for Windows users wants the user SID and the SID of the groups to which the user belongs.

To do this I have implemented 2 Extension Methods into the namespace NetSqlAzMan.Cache for the WindowsIdentity class.

To obtain this SIDs you can:

1) Use the name (UPN) of the user... (user@mydomain.ext) to create the WindowsIdentity object, using Kerberos protocol Transition:

WindowsIdentity myWinuser = new WindowsIdentity ( "user@mydomain.ext");


2) Get the SID using Extension Methods:

using NetSqlAzMan.Cache; / / <= IMPORTANT to see Extension Methods!


string userSID = myWinUser.GetUserBinarySSid();

string [] userGroupsSIDs = myWinUser.GetGroupsBinarySSid();

3) Invokes NetSqlAzMan WCF Service Cache passing the above SIDs



Andrea Ferendeles
NetSqlAzMan - Project Coordinator