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

x
?
Solved

How to get REMOTE_USER Environment Variable

Posted on 1998-12-07
7
Medium Priority
?
927 Views
Last Modified: 2013-11-24
When using Netscape Serever's security,
it pops up a dialog box.  When the person's
login is validated, the login name is stored
it the browser environment variable REMOTE_USER.
This can be grabbed using CGI.  My problem is that
I hava a java applet that needs to know who
the validated user is.  Anybody know how I can
get this variable in Java, or pass it as a
parameter to the applet using javascript or something?
0
Comment
Question by:revferret
[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
7 Comments
 
LVL 4

Expert Comment

by:evijay
ID: 1228877
one way is to write a cgi program/java servlet which you invoke from java applet and that program/servlet returns you the remove user name. This is the only way also to get any client certificates of the browser.

Vijay

0
 
LVL 1

Expert Comment

by:GregL
ID: 1228878
Try HttpServletRequest.getHeader( "REMOTE_USER" );
0
 

Author Comment

by:revferret
ID: 1228879
Sorry, but this didn't work.
Java didn't find the class HpptServletRequest, and I don't seem to have any
class libraries that have this?  Do you know which set of libraries have this?
I have imported all the libraries that came with netscape server.
0
Industry Leaders: 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!

 
LVL 7

Expert Comment

by:conick
ID: 1228880
The HttpServletRequest class is part of the Servlet API (its a separate download)
This involves writing a servlet. (its suprisingly easy)
Make sure your server is capable of running servlets
If you decide to do this you can get the Servlet API from:
http://java.sun.com/products/servlet/index.html


0
 
LVL 16

Expert Comment

by:heyhey_
ID: 1228881
>> ... This can be grabbed using CGI. ...

you sure need some kind of server support ...
 evijay suggests to use a simple CGI, and GregL suggests to use servlets (which is some kinf of Java CGI)... in both cases you need a server program (CGI) that will give your applet the  REMOTE_USER variable (the applet simply sends "Give me the value of REMOTE_USER" and the CGI returns it).

hope this helps
  heyhey

P.S.
i just sow that line
>> it the browser environment variable REMOTE_USER.
if you browser can see this variable (if it is client variable, not server variable) you can use JavaScript and give this value as applet parameter.
0
 
LVL 7

Accepted Solution

by:
yoren earned 200 total points
ID: 1228882
REMOTE_USER is a server environment variable, not a browser variable. This is an important distinction. Keep reading.

It sounds like you have a CGI program which is returning a page containing an applet. If this is the case, your CGI program should dynamically add an applet parameter that contains the value of REMOTE_USER. If your CGI program is written in Perl, it will look something like this:

print "<APPLET...>\n";
print "<PARAM NAME=\"REMOTE_USER\" VALUE=\"$ENV{'REMOTE_USER'}\">\n";
print "</APPLET>\n";

Then use Applet.getParameter() in your applet to retrieve the value.

BUT BE WARNED: Don't use this as your method of security, because it would be very easy for a hacker to crack this security. You should assume that anyone who can run the CGI can pretend to be anyone else who can run the CGI.

Yuval
0
 

Author Comment

by:revferret
ID: 1228883
Thanks for the suggestion, but I figured out how to write a WAI application
and register it as a service with the Web Server.  My applet just calls this
service and then the REMOTE_USER is returned to the applet.

Thanks all for the help!
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses

610 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