How to get caller identity in a self-hosted CoreWCF server?

Viewed 29

I am converting some legacy code to .net6. I have a WCF server implemented as a Windows Service which uses ServiceSecurityContext.Current.WindowsIdentity to inspect the caller. The caller will typically be a Powershell client.

I am using CoreWCF to help with the conversion but I cannot seem to configure it in such a way that this value is populated with a value when a caller hits one of the server methods.

Does anyone have a working example of this kind of thing? The CoreWCF samples don't help and my review of stackoverflow answers etc. hasn't found anything that is directly useful.

Many thanks indeed.

1 Answers

I don't know if CoreWCF can convert this code, but you can try the original WindowsIdentity class to see if it works.

Related