Display window username using javascript

I want to get a username for login and display it in a browser. Is it possible to use java script for the same?

+3
source share
4 answers

I think you can use the ActiveX control (ActiveXObject ("wscript.network")) Example:

var ActiveX=new ActiveXObject("wscript.network");
alert(ActiveX.username);
alert(ActiveX.computername);
alert(ActiveX.userdomain);
+2
source
<script type="text/javascript" language="javascript">   

var objUserInfo = new ActiveXObject("WScript.network"); 
document.write(objUserInfo.ComputerName); 
document.write(objUserInfo.UserDomain); 
document.write(objUserInfo.UserName);   

</script>
+1
source

, Javascript , . Javascript - , , .

ActiveX Kerberos/NTLM script , , javascript. Internet Explorer.

HTTPAuth, , / , javascript .

0

Javascript - , ...:)

EDIT: @thomas are trying to be more specific ... do you want to build a platform in which users can log in? then use the database in which you store users. Why do you need login windows?

0
source

Source: https://habr.com/ru/post/1717322/


All Articles