You can do what krakatoa suggests, but you'd need to use a signed applet in a web page
Main Topics
Browse All TopicsHi, I need to create a Java Class which I can instantiate in a different programming language to get the values of a logged on windows user with domain. I have a asp page where I use ServerVariableName("Logon_
So in short, I need a java class which i can instantiate from a non-java programming language which gets me the windows logged on username. If it can get the password, that is great too.
Users will be logged on Windows platform, thus info is in AD.
I dont know Java and your hellp is appreciated.
Thanks,
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
How do I do that. I dont know Java at all. I need to create a class. Problem is that the proprietry language i use can only instantiate Java objects. I think it wants me to create a dll file or some file than import it. I dont know how to do it. I need a lot of help there.
The code Krakatoa gave, I already had it. I just didnt know how to create a class which has a property or a method which returns the username.
Unfortuantely, I will be running files on weblogic server which is JSP. However, This is what I am trying to do. You may have a better suggestion.
I have an ERP system where i want to setup a single sign-on with their logged on username on the web. I just need the logged on username. I can use an asp page and do it. However, I want to either call a java object or a windows object and do it. However, windows one is tricky and doesnt work that well. Its easier for me to call and instantiate a java class i have which has a method or a property getting me the name of the user logged on.
From there, I can take care of it. So my plan was that if there is a dll (i dont know what java has :P ) i can import and then call that object, it may work.
Also I tried the code above but doesnt return me the username.
The code posted will work - it just has to be used in the right context. That context is a signed applet running on the machine of the user whose name you want. See
http://www-personal.umich.
Alright the web solution is not feasable. I am going back to the basic. I need to have a java class created called loggedonuser.jar which i can instantiate and call a method which gets me the logged on user back. how hard it is to do it. Again, I dont know java. I have to do it in simple java. no web applets etc...
i just realized something. when i create a jar file and put it out there. it gives me a different error. but with the class file, it gives me the bad magic number. I dont know how to create a class file alone in ecl;ipse. i go to export. then pick as jar file and then pchange teh name to .class instead of .jar. is this correct
so how do i do it with the applet but using a class.
some of teh avriables i found that i can read are (in jsp)
String accept = request.getHeader("accept"
String user_agent = request.getHeader("user-ag
String accept_charset = request.getHeader("accept-
String accept_language = request.getHeader("accept-
String x_wap_profile = request.getHeader("x-wap-p
String profile = request.getHeader("profile
Business Accounts
Answer for Membership
by: krakatoaPosted on 2008-05-16 at 23:28:42ID: 21588174
>Create a Java Class which returns the logged on Username from Windows ...
ame");
String User = System.getProperty("user.n