Reputation: 1369
I'm trying to get a unique key from client such username or computer name but on wcf side none of the following works for me:
HttpContext.Current.Request.LogonUserIdentity.Name // blank
Security.Principal.WindowsIdentity.GetCurrent().Name
I'm using Anonymous mode for security and user shouldn't be logged on anyway. How can I do this ?
Thanks.
Upvotes: 1
Views: 1871
Reputation: 31651
You could try accessing the Request.ServerVariables
to retrieve the consumers IP Address?
Here's a list of common Server Variable Keys.
This SL forum post suggests using a GUID kept in isolated storage that is sent back and forth for context.
Upvotes: 0
Reputation: 28325
If you are using anonymous authentication mode, then a blank Name is what you get. As the mode implies, the request is kind of.... anonymous.
If a unique identifier is what you need, I think your best bet in this scenario would be to add a custom header to your request containing a Guid created at first run and preserved in isolated storage.
Upvotes: 1