Solved

Capturing Win2000 username using JSP or javascript???

Posted on 2002-07-24
5
185 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
Comment Utility
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
Comment Utility
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
Comment Utility
doesn't remote_header do what is needed here?

CJ
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
HOW TO: Connect to the VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere (HTML5 Web) Host Client 6.5, and perform a simple configuration task of adding a new VMFS 6 datastore.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now