Solved

Capturing Win2000 username using JSP or javascript???

Posted on 2002-07-24
5
195 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
doubleChar java challenge 7 121
How to find missing packages when using Netbeans IDE 8.1 ? 19 59
spring example non maven 4 92
throw exception 21 58
The business world is becoming increasingly integrated with tech. It’s not just for a select few anymore — but what about if you have a small business? It may be easier than you think to integrate technology into your small business, and it’s likely…
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

837 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