IPrincipal from WCF request

Can I get IPrincipal admin request windows when it uses the WCF service?

+4
source share
1 answer

Using this code, you can check the current security context inside your WCF service.

If the user is authenticated and WindowsPrincipal is not null, then you use the Windows security model - you can access all the relevant information:

ServiceSecurityContext current = ServiceSecurityContext.Current; if (!current.IsAnonymous && current.WindowsIdentity != null) { string userName = current.WindowsIdentity.Name; } 
+5
source

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


All Articles