Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Capturing Win2000 username using JSP or javascript???

Posted on 2002-07-24
5
Medium Priority
?
201 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

609 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