Solved

Capturing Win2000 username using JSP or javascript???

Posted on 2002-07-24
5
194 Views
Last Modified: 2012-05-04
I need to be able to get the name of the user that is currently logged into windows.  Any ideas?  I am using jsp and weblogic on a win2000 platform.
0
Comment
Question by:xlr8tn
  • 2
5 Comments
 
LVL 19

Accepted Solution

by:
cheekycj earned 200 total points
ID: 7175041
I don't think you can get the windows login name from Java.  You may have to use JNI to access some native windows script to do that.  Not sure though.

However, if you use http authentication or realm based login you can do the following:

If the browser sends the Authorization info, you can retrieve it using REMOTE_USER environment variable.

try either:
request.getRemoteUser();

or

request.getHeader("remote_user");

to see all the headers do this:
    Enumeration headerNames = request.getHeaderNames();
    while(headerNames.hasMoreElements()) {
      String headerName = (String)headerNames.nextElement();
      out.println(headerName + ":" + request.getHeader(headerName) + "<BR>");
    }

HTH,
CJ

0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 9561084
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

"To be deleted/no refunds."
 
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Kuldeepchaturvedi
EE Cleanup Volunteer
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 9562091
doesn't remote_header do what is needed here?

CJ
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Jquery - parsing the results returned from webmethod 1 113
java cyclic graphs 15 210
servlet init param and contect param 3 65
login jsp example 24 51
If you thought ransomware was bad, think again! Doxware has the potential to be even more damaging.
Adding Computers to AD groups through an SCCM Task Sequence
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question