aJ.
aJ.

Reputation: 35480

How to get WindowsIdentity for a remote logged in user?

I am working on client server application with following details:

Client(C++) -----------HTTPS---     Server (C#/WCF)

Server:

Client:

Currently I am working to authenticate windows user logged-in in client at server:

I have tried following:

Questions:

  1. How to get the windows identity in server (C#) from the SID of the logged in AD User passed from the client?
  2. Are there any other better ways to achieve the above setup?

Upvotes: 0

Views: 1734

Answers (1)

BRAHIM Kamel
BRAHIM Kamel

Reputation: 13794

have you tried

ServiceSecurityContext.Current.WindowsIdentity.Name

but there is no way of converting the username format without involving a query to Active Directory. Since that is the case there is no need to create WindowsPrincipal for checking the group membership since that would probably need yet another connection to AD. try to use the solution provided in this link

Upvotes: 3

Related Questions