Asp.Net: Request.LogonUserIdentity

P1ST0LPETE used Ask the Experts™
Hi Experts

Just discovered "Request.LogonUserIdentity" while writing some code to determine if the user's browser supports javascript (i.e. Request.Browser.JavaScript).

Anyway, tried out the following line of code:

string test = Request.LogonUserIdentity.User.Value;

And I see that I get a value like this:  S-1-4-21-2199612581-739213201-14517828-2116

1. What exactly is this number string?
2. Is it unique to all users, possibly a way to uniquely identify users?
3. Are you still able to obtain it if the user is on a linux, mac, or some other non-windows machine OR using a handheld mobile device?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Independent Consultant

I believe it is globally unique to a specific windows authenticated user.

Unless the Linux or Mac system is running some sort of windows authentication software, no.

The value returned by the property Request.LogonUserIdentity.User.Value is called security identifier (SID) which is a unique value of variable length that is used to identify a security principal or security group in Windows operating systems.

It is unique for all users in a windows domain. Refer the following details
How Security Identifiers Work
HttpRequest.LogonUserIdentity Property  returns an object of the type WindowsIdentity which represents a a Windows user. Therefore you cannot obtain the SID if the user is on a linux, mac, or some other non-windows machine or using a handheld mobile device unless they passed Windows credentials when they access your application.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial