How to pull Citrix username into Java application - java

I have an application that pulls the windows user's user name and uses that name to check against a database and provides various alerts when needed for that user name. I am needing to modify the program to be able to pull the Citrix username instead but I can not find any information on this. Does anyone know if this is possible?

I don't know about how to pull Citrix but if you need the username and if it's available according to the privileges request.getRemoteUser() or request.getUserPrincipal() should work otherwise you can try
System.getProperty("user.name") but it will only give you the username of the user running the java process.

Related

How can i get the windows username of a visitor in Intranet

How can i get the windows username of a visitor that comes to my page.
My page is coded in Java and runs in Intranet.
I know it easy to do this with aspx (with activex i think) but how can i do this with Java.
In some topics i found some thing like this.
How to get Windows username in Java?
Get login username in java
But these are not a solution for me because;
System.getProperty("user.name");
System.getenv("USERNAME");
gives the user name of the server which the program runs on.But i need the visitors user name.
Is there a way to do this?
In a stable, corporate environment it is often posible to make a small "login & authentucation service" within ERP (C#), accessed via REST/JSON or SOAP with Java code. I did this a few times.
As a consequence, every successfully logged worker is a Java proxy to the primary login from the main system.
Big benefit: not to build hard security mechanism. Password are never copied in Java database.
Some problems: A user may have been the author of some content in Intranet. Now they are no longer part of the company, their primary login is destroyed, intranet should have very light "shadow" of dead soul.
Getting windows login is tricky. In many companies it is allowed to use browser from computer of coworker, with login to specyfic www application.

Java program to get windows system username

I'm developing an application that would be hosted on tomcat server. I'm looking to get the username details with which the user would logon to his windows system for tracking purpose. Is there a way to get the user name details with which the user logged onto the system before accessing the application through a browser?
i doubt there is a java only way to do this. you have to check the username using javascript. here is an example for windows user:
Get Windows username with JavaScript?
Also you probably want to do the same for Linux/Mac users?
Once you got the java script name you could either save it into a cookie and read it with your Java servlet or send an Ajax request to your backend.

JAVA - Active directory and ldap password properties

I'm using a program that adds correctly a user to AD using LDAP protocol.
I noticed that there are some properties about the password. There are userPassoword that stores password in clear and unicodePwd that accepts encoded pwd.
I'm working in a project where a lot of users were created by the admin in AD, using Windows server administration tool. But what suprise me more, is that these users have password and the app workws fine with the login...but BOTH properties are empty! So, where are the password?
By Java I have to add the passwords in the same way, but I cannot figure out how to approach the problem, because I don't know where those users' password are stored.
Any ideas?
You cannot read a password from AD. There is special logic in the directory to handle writes to those attributes, but, there is no read capability. They will always appear to be null.

To retrieve logged in user's Active directory data from Websphere

In my application, I use Websphere single sign on authentication. I want to retrieve the logged in user's name, e-mail Id and distinguished name. Almost all the solutions in google are using LDAP server to retrieve the values. I want a solution that doesn't use LDAP as I have already connected to Active Directory through websphere. Please help me with this.
Logged on user is represented as a set of principals within JAAS subject. Information like user name or email is not present there and is not supposed to. You have no other option other than query LDAP (Active Directory in your case).
The statement like "i have already connected to active directory" does not make much sense. Yes, the user is authenticated by WAS through AD, but this does not mean that any sort of persistent connection exists.

multiple active directory server authentication using java

i have three active directory servers different address,port and domain name and all
In my app when user log-in the system i have to authenticate. The user provide his username and password only not the domain name or ip address.
How can i authenticate him, whether i have to loop through the all the ldap server and when i get the Context i have to break it .. or is any other possible solution is there for authenticate a user in multiple servers
please suggest. thanks in advance
If the user gives his FDN or UPN (User Principal Name) instead of just an user name it will be helpful. But still there is no guarantee that upn will match your realm name. If he gives FDN then atleast you can cache defaultNamingContext from all the three server and try to match it with the fdn provided by the user and authenticate him against the matching server.
But I guess he is providing the samAccountName in your case. In this case we dont have any clue to identify the server. You have to go through one by one and probably cache it which server he is authenticated against for next time performance improvment. Its also possible that the same username exist in multiple AD. You have to handle this case based on your AD environment.
as a additional note, if its web application try using spring's ldapTemplate. This might ease your task.

Categories

Resources