Get current windows user name and domain information ?

1,314 views
Skip to first unread message

Prayag Ganoje

unread,
Sep 15, 2016, 2:56:08 PM9/15/16
to AngularJS
I need Windows userName and Domain information on the landing page developed using AngularJS.

Is there any way to get Windows userName and Domain name ?



In ASP.NET MVC there is HttpContext.Current.User.Identity.Name to get this kind of information.

Looking how to achieve similar thing using AngularJS ?

Sander Elias

unread,
Sep 15, 2016, 3:07:43 PM9/15/16
to AngularJS
Hi Prayag,

Unless MS has something specially arranged for this in IE/EDGE that I don't know of, it's impossible to get this data from withing the browsers sandbox. Browser vendors went to extreme length to prevent this (and any other kind) off access to system resources. Google for browser sandbox if you want more detailed information.

This is a security measure. We don't want that to be changed. Think about it, do you want a browser that makes private system resources available on the internet?

Regards
Sander
Reply all
Reply to author
Forward
0 new messages