I need to get OS username, to send to a .net web api that will make an active directory checking if that user exists there and return the user info. This is for hospital staff, that will use this app in their chrome books, so I need to check if the user who entered the operating system exists in the AD.
Asked
Active
Viewed 2,037 times
0
-
It's really JavaScript, nothing special, [here is the solution](https://stackoverflow.com/questions/9514179/how-to-find-the-operating-system-version-using-javascript) , investigate a bit more, there are more things you can extract using window.navigator. – Moshe Binieli Sep 27 '18 at 15:47
-
Possible duplicate of [How to find the operating system version using JavaScript?](https://stackoverflow.com/questions/9514179/how-to-find-the-operating-system-version-using-javascript) – Lazar Ljubenović Sep 27 '18 at 16:39
-
By the way, it's OS _name_, not _username_. – Lazar Ljubenović Sep 27 '18 at 16:39
-
no, i want OS User name... not OS Name – Alexandre Ribeiro Sep 27 '18 at 16:41
-
how the angular app is hosted? in a node (express) environment or IIS? Are you trying to make a request to another web api rest service? – Jesus Gilberto Valenzuela Sep 27 '18 at 17:50
-
will be hosted in IIS yes, and the webapi will be too. – Alexandre Ribeiro Sep 28 '18 at 08:11
1 Answers
1
Use the AUTH_USER and/or LOGON_USER server variable. That should do it if it's hosted on IIS. On the backend you could do:
Request.ServerVariables("LOGON_USER")
, but this may be vb.net specific.
See https://msdn.microsoft.com/en-us/library/ms524602(v=vs.90).aspx

jason
- 2,219
- 5
- 33
- 66