Answer the question
In order to leave comments, you need to log in
How to find username in Windows using JS or Java Applet?
How to find username in Windows using JS or Java? The name under which the user is logged in is required.
You need to write this name to a variable and identify the user in the browser.
Do not offer ActiveX.
Or is there any way to implement this
Answer the question
In order to leave comments, you need to log in
A more complete formulation of the problem is needed. Starting with the answer to the question "why"?
Do I understand correctly that I want to get in an arbitrary browser the name (account ID) of the user under which the user logged into his operating system (launched the browser)? At the same time, the web server is not connected to the user's working machine in any way (for example, by general authentication)?
If yes, then most likely there is no general solution. For an application that runs in a browser, in the general case, such information is not needed, and the availability of such information is a data leak, which is not good from a security point of view.
If this is a corporate network with a single authentication (Kerberos, MS Active Directory, etc.) and you want to make a "transparent" user authentication in the application, then this is solvable. Look towards GSSAPI, NTLM, "Integrated Windows authentication".
nonsense - in the place "to identify the user in the browser".
the name in this case cannot be an identifier.
https://developer.mozilla.org/en-US/docs/Mozilla/T...
env USERNAME
JSP is definitely out of business here.
You can try to call in the applet String user = System.getenv("USERNAME");
, but you need to understand that applets are limited in runtime by their sandbox and cannot execute unsafe code. Read here docs.oracle.com/javase/tutorial/deployment/applet/... and here docs.oracle.com/javase/tutorial/deployment/doingMo...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question