?
Solved

Capturing Win2000 username using JSP or javascript???

Posted on 2002-07-24
5
Medium Priority
?
199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 19

Accepted Solution

by:
cheekycj earned 800 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

New style of hardware planning for Microsoft Exchange server.
Check out the latest tech news, community articles, and expert highlights in August's newsletter.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

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