Im using Struts 1.2 and JBOSS Application Server.
My server is mounted on LINUX server.
Iam working on Single Sign On feature in java., For that I need to get the user name of the logged in user. For that Im using System.getproperty("user.name").
Im getting the user name in my localserver (which is windows)., but when i ran the same code in LINUX server., it is showing the user name of Linux machine Server Name.
I need to know, how to get the user name of windows logged in user in Linux using Java code.?
You appear to have arrived at the wrong location; this forum is for discussing the forum. I shall try to move you elsewhere.
Please explain more of what you require. You are on a Linux server and there is somebody on a Windows box using your services and you want the user name of the distant user? How would you do that without using Java? System.getProperty gives you the details of the local machine, so you wouldn't expect it to give information about a distant machine.
I have developed a J2EE Web Application and that application runs on JBOSS 6.1.0 Application Server.
This application is used by 500 people across my Organisation.
The production server is LINUX (CentOS), where the JBOSS is mounted.
All the 500 users are using Windows 7 System and they need to login to the application. Here, instead of giving the username and password, we are tying to capture the Windows Logged in Username and using this name, we are using LDAP services to hit the Active Directory and processing the work.
My Problem is, I'm getting all the 500 users Logged in Name when the JBOSS runs on a windows machine as a server. But My Production server is mounted on LINUX, which returns the same Server Machine Name for all the 500 users., I don't need the Linux Server Machine Name and all i need is the Windows Logged in Name.
If you are using SSO, the users won't be logging into the application, they'll have logged into the SSO system, and if the SSO system is in turn including the Windows login, then you've "logged into the application" when you logged into Windows.
This is why there's no login listener for J2EE webapps. Because when the system handles authentication and authorization, the login may have been done somewhere else at some other time through some other app.
Wildfly uses a modified version of Tomcat as its servlet/JSP engine and Tomcat employs plugin Realm modules to handle container-managed authentication and authorization needs. For a stand-alone Tomcat, there's a CAS Realm that's popular for SSO. I seem to recall that last time I looked at JBoss, that it has a slightly different security manager of its own these days, so check the docs.
Also, be aware that to get Windows machines to share their LAN credentials with a web server you may have to change some registry settings on each participating client machine.
Bjoke: A "Bully Joke". A Statement or action made with malicious intent - unless challenged. At which point it magically transforms into "I was just funnin'" or "What's the matter, can't take a joke?"
Wildfly uses a modified version of Tomcat as its servlet/JSP engine and Tomcat employs plugin Realm modules to handle container-managed authentication and authorization needs.
Tim, JBoss application servers till the version 7 used to hav a modified version of Tomcat as its JSP/Servlet engine (it was called JBoss Web). However, WildFly (the renamed version of JBoss AS) whose first release version was WildFly 8 uses a completely different JSP/Servlet engine named Undertow http://undertow.io/ which has been written completely afresh by the JBoss team. Undertow doesn't use Tomcat and in fact is also a independent web server (i.e. can also be used outside of WildFly).
Am I correct in assuming that you want the user name from the client's computer? I believe there may be solutions for that which work in a Windows network, but for general networks (such as me connecting to the Ranch server) there isn't a way to find out how the user signed on to their computer. Which is a good thing in the general case because my user ID on my home computer is none of the Ranch's business. However you may be asking about a Windows LAN, in which case solutions may exist.