Get client username
hello can u help me how to retrieve the client username.don't want to use System.getProperty(user,name) becoz this gives me the user of the server. thks
You can only get the client's username if the client chooses to make it available to you.
If you know the client is going to be using an NT Domain account or a similar package, you can get it via JNDI. Considering that I can log into my Windows 2000 Pro computer without setting my NT Domain account, I think you should just ask the client for a username and password.
Similar Messages
-
Hi Experts,
I have a problem in retrieving my client's computer name and its username using windows api..
Coz my program is using JNI so for the windowsAPI i used GetUserName and Get ComputerName --> It gives me the username and the computer name of the server..
Any idea how to get another (computer username and its computer name PASSWORD IF POSSIBLE) that logon to my server.
Any suggestion will be highly appreciated..
Thank you
SuwandyAny idea how to get another (computer username and its
computer name PASSWORD IF POSSIBLE) that logon to my
server.
High hopes
What are your clients?
Java,jsp,html or are they servlets
-Regards
Manikantan -
Is it possible to have a jsp retrieve a clients username automatically (much like the java call System.getProperty("user.name"))?
I know that I can use cookies for everything but my boss doesn't want to ever make a user log into the system. We are on a closed network so security isn't a major concern.
Once I have the password, the JavaBean will handle retrieving the user password from a system file on the server. I just need to be able to get the username of the client machine.You'll need the latest JAAS.
Every client will need to have at least the Java1.3 plugin running.
http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/using_tags.html
You'll write an applet and the applet will need to be signed. Not as hard as it sounds but I don't have the link.
Here is the applet code:
import java.applet.*;
public class ntApplet extends Applet {
private String userName = "NONE";
public void init() {
System.out.println("INIT");
try {
com.sun.security.auth.module.NTSystem ntSystem = new com.sun.security.auth.module.NTSystem();
userName = ntSystem.getName();
} catch (Exception e) { System.out.println("Error : " + e + "\n"); }
System.out.println(">>>>" + userName + "<<<");
}//End Init
public String getUserName() { return this.userName; }
}//End Class<P>
Here is some sample HTML:
<html>
<head></head>
<body onLoad="getName()" >
HERE IS SOME TEXT BEFORE THE APPLET <P>
<form name="form1">
<input type=text name="name" value="XXXXXXXX">
<button type="button" class="stdButton" onClick="getName()"><b>Clear</b></button>
</form>
X<applet
codebase = "."
code = "ntApplet.class"
archive="ntApplet.jar"
name = "ntApplet"
width = "1"
height = "1"
hspace = "0"
vspace = "0" MAYSCRIPT></applet>X
<P>
HERE IS SOME TEXT AFTER THE APPLET
<P>
</body>
<html>
<Script Language="JavaScript">
function getName() { document.form1.name.value=document.ntApplet.getUserName(); }
</Script> -
How can I get the UserName in JAX-RPC?
The client is just as following:
import javax.xml.rpc.Call;
import javax.xml.rpc.Service;
import javax.xml.rpc.JAXRPCException;
import javax.xml.rpc.namespace.QName;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.ParameterMode;
public class ACTRPCClient {
private static String qnameService = "Hello";
private static String qnamePort = "Greeting";
private static String BODY_NAMESPACE_VALUE ="http://hello.org/wsdl";
private static String ENCODING_STYLE_PROPERTY ="javax.xml.rpc.encodingstyle.namespace.uri";
private static String NS_XSD ="http://www.w3.org/2001/XMLSchema";
private static String URI_ENCODING ="http://schemas.xmlsoap.org/soap/encoding/";
public ACTRPCClient() {
public static void main(String[] args) {
try {
String endpoint= "http://127.0.0.1:8080/SOAPListener/Hello";
ServiceFactory factory =ServiceFactory.newInstance();
Service service =factory.createService(new QName(qnameService));
QName port = new QName(qnamePort);
Call call = service.createCall();
call.setPortTypeName(port);
call.setTargetEndpointAddress(endpoint);
call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
call.setProperty(ENCODING_STYLE_PROPERTY,URI_ENCODING);
//here I set the username and password
call.setProperty("javax.xml.rpc.security.auth.username","tomcat");
call.setProperty("javax.xml.rpc.security.auth.password","tomcat");
QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
call.setReturnType(QNAME_TYPE_STRING);
call.setOperationName(new QName (BODY_NAMESPACE_VALUE, "getHello"));
call.addParameter("Greeting", QNAME_TYPE_STRING, ParameterMode.PARAM_MODE_IN);
String[] params = { new String("Hello!") };
String result = (String)call.invoke(params);
System.out.println(result);
} catch (Exception ex) {
ex.printStackTrace();
On the server side,I wrote a my own servlet to receive the soap instead of the jax-rpc.But I can't get the username from the request.
for example,
String username;
username=request.getRemoteUser();
I noticed that in the api doc,it says when the user has not been authenticated the method getRemoteUser will return null.So I use the username "tomcat" ,password "tomcat "in the tomcat-
users.xml.But I still can't get the username,why?
Thanks for your help.From the Axis I find the problem,the username and password is stored in the headers of the http.
And now the jax-rpc only surpport basic authentication,we can get them by calling request.header("Authentication").Howerver,the infomation is encoded by Base64.We copy a module from the Axis to decode the infomation.That's it,but still thank your attention. -
Where does Lion get its usernames? (former Linux user)
Just some minutes ago, I opened the lid of my Macbook and noticed that something was using the CPU for 50% continuously. When I opened Activity Monitor, the only two CPU-using processes were kernel_task and WindowsServer, but not enough to cover 50%.
Safari also wouldn't respond. Force-quitting worked, but starting it again would show the window but then result in a spinning beachball of death.
When I opened the terminal, the prompt said "I have no name!@macbook$ "
When I typed the command "id", it gave me a user ID (502) but no username!
After killing all apps and mucking about, the CPU suddenly went back to the normal 3-5% usage, and everything worked fine again.
Obviously, something went wrong with the process that does the user identification. As a former Linux user, I'd say the user data resides in /etc/passwd but that's not where it's at. Where does Lion get its usernames and passwords?OK thanks for the DSCL tip. I've found another thread with the same symptoms:
https://discussions.apple.com/thread/3663559
The logs of the opendirectoryd process show that it restarted itself (from /var/log/opendirectoryd.log):
2012-04-15 13:26:56.346 CEST - Loaded bundle at path .....
The system logs show a couple of errors from coreservicesd:
Apr 15 13:03:32 macbook coreservicesd[31]: _scserver_ServerCheckin: client uid validation failure; getpwuid(502) == NULL
And then thousands of these two lines follow:
Apr 15 13:03:43 macbook xpchelper[95253]: getpwuid_r() failed for UID: 502, ret: 0, errno: 0
Apr 15 13:03:43 macbook com.apple.launchd[1] (com.apple.xpchelper.F6010000-0000-0000-0000-000000000000[95253]): Exited with code: 1
Let's see if it happens again in the future. I'm logging this for reference and Google. -
HELLO
im developing a WEB application using JSP AND JSF and we are trying to integrate the security model with novell.... we need to get the actually username connected in the novell client and send it to the server for some security roles.... i know that is possible get the window connectd username with javascript like this:
var wsh = new ActiveXObject('WScript.Network');
var usuario = wsh.UserName;
document.menu.cdUsuario.value=usuario;
document.menu.intOperacion.value=9;
//alert(document.menu.cdUsuario.value);
document.menu.submit();
but how in this case novell not necessary is the same username that windows i need to get the novell username to send it to the server ...if SOME one know the way or some idea to implement this? or get the actually novell in the client.... thanks if some obody can help me and excuses for my bad english xD!You can use the J2EE methods:
EJB container:
SessionContext.getCallerPrincipal
Web container:
getRemoteUser
getUserPrincipal
A good J2EE book / tutorial will explain these in detail.
Sincerely,
Daniel Selman
"jpmeert" <[email protected]> wrote in message
news:3c8f49a4$[email protected]..
hello!
how can i get the username of a logged user in the portal 4.0?
i didn't find a tag in usermanagement, portalmanagement! -
Hi,
In my java application I have following code to get windows username-
*<%*
String s1 = System.getProperty("user.name");
out.println("The Username : "+s1+" ");
String s2 = System.getenv("USERNAME");
out.println("The Username : "+s2);
*%>*
If I log in to my PC and execute it I get correct output for both the statements, But when I execute it on server machine(when I logged in) I get the output as-
The Username : SYSTEM The Username : null
I use Apache Tomcat 5.5 to run the jsp on both (PC & server) machines. One small difference is I use eclipse on my PC and I don't use eclipse on server (I think it doesn't matter).
But when I use the same code inside a java class I get correct output on both (PC & server) machines.
Can any one solve my problem.
Thanks in advance,
Tiijnartiijnar wrote:
Hi BalusC,
Thanks for the reply.
Could you please be more elaborted on this. What I mean is- can you provide me the code for the applet.Just the same code. Use System#getProperty() in an applet. The only difference is that the applet runs at the client machine and the Java web application runs at the server machine. If your problem is rather that you don't know how to use applets, just check the applet tutorial here at sun.com. Google can find it.
Moreover when I execute jsp on my PC, I execute it on localhost (a server inside my PC). I face the problem when I host my application on my server machine.D'oh. On "localhost" the client and the server are physically on the same machine. -
How to get the username in a custom password change routine / procedure / form when a user's password has expired and is redirected automatically to this custom program?
We use the 2nd parameter in LOGIN_URL column in WWSSO_LS_CONFIGURATION_INFO$ table to get to this custom change-password proc.OK !
Use that maybe good :
select USERID into v_user from sys.aud$
where ntimestamp#=(
select max(ntimestamp#)
from sys.aud$ ); -
How to get client IP in custom UCM Service
how to get client IP in custom UCM Service ?
have you tried
binder.getLocal("REMOTE_ADDR");
Let us know how you get on
Tim -
I am having trouble connecting MacBook Pro (10.6.7) to Novell server. I get incorrect username and password message. I can connect worksations running 10.5 without any problem. Any possible solution? Thanks, Ned
Having the exact same problem with connecting ML and Snow Leopard machines to a Windows 8.1 machine. Oddly enough, connecting and copying to/from works perfectly from a Mavericks machine, despite the problems reported about Mavericks regarding the exact opposite. An old thread, but did you find a solution?
-
How to get windows username printed on each page irrespective of application? we have HP CM6030F.
Hi,
Normally, you will receive a Windows Azure Pass from your local Windows Azure team. Please try to contact your local Windows Azure contact (http://support.microsoft.com/gp/customer-service-phone-numbers?wa=wsignin1.0
Also, you could see this page
http://www.windowsazurepass.com/AzureU/AcademicFAQ and apply the free trial azure via (http://www.windowsazurepass.com/AzureU/).
Q: I am a student. Can I apply for a pass?
A: Windows Azure Educator Grants are only for valid faculty. If your faculty has been awarded a Windows Azure Educator Grant, you will be able to get a pass through him/her for you coursework. If you are interested in learning more about Windows Azure,
we encourage you to share these Educator Grants with your faculty or sign up for the FREE 3-month trial offer.
Regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How can I get the username displayed in BW Web-Report?
Hello all,
I try to get the username displayed in BW-Report such as 'welcome <username>'.
Maybe you can give me a suggestion how to do it.
I appretiate your answer.
Regards
Vivianyou can use the following javascript within the webtemplate to get the user id
<script language=javascript>
var user_name ='<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="TEXTELEMENTS_USER"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_TEXT_ELEMENTS"/>
<param name="DATA_PROVIDER" value="DP"/>
<param name="GENERATE_CAPTION" value=""/>
<param name="ELEMENT_TYPE_1" value="COMMON"/>
<param name="ELEMENT_NAME_1" value="SYUSER"/>
<param name="ONLY_VALUES" value="X"/>
ITEM: TEXTELEMENTS_USER
</object>';
</script>
Regards
Raja -
Use ADF Managed Bean to get the username in BPM Workspace
Hi all,
I used JSF and ADF to build the UI of human task. And I want to get the username of the user who is manipulate on BPM Workspace. For example, an ADF form can display the username of current user in BPM Workspace. I also try this approach: use Manage Bean, and bind this bean to a output text in ADF form. The code fragment I use to get the current username is:
ADFContext.getCurrent().getSecurityContext().getUserPrincipal().getName();
But it does not work. The value I get is Anonymous.
So, plz help me solve this problemHi, please try this function as below:
public String getUserLogin() throws WorkflowException,
BPMIdentityException,
BPMUnsupportedAttributeException {
String userId = "";
IWorkflowServiceClient wfSvcClient;
ITaskQueryService queryService;
IWorkflowContext wfContext;
// Get username of User Login
String contextStr = ADFWorklistBeanUtil.getWorklistContextId();
wfSvcClient = WorkflowService.getWorkflowServiceClient();
queryService = wfSvcClient.getTaskQueryService();
wfContext = queryService.getWorkflowContext(contextStr);
userId = wfContext.getUser();
return userId;
Regards. -
Hey one question, if i buy an Ipod in Germany, can i get client support in Mexico?
if i buy an ipod in germany, can i get client support in mexico?
https://www.apple.com/legal/warranty/
-
How can I get Client IP Address in oracle?senthil
How can I get Client IP Address in oracle?senthil
Hi,
Following query can help you to get the Client IP Address.
select sys_context('userenv','ip_address') from dual;
Thanks,
Maybe you are looking for
-
Error deploying BPEL process on SOA Suite 11g
Hi, We have installed SOA Suite 11g (Weblogic 10.3.1.0) on Windows. I'm trying to deploy a simple BPEL Process on this SOA Suite through JDeveloper 11.1.1.1.0 Studio. However I'm getting the following error: [10:29:08 AM] Preparing to send HTTP reque
-
Alright. This card was working with my old motherboard just fine but now I am having some problems. Here are my specs. Windows XP PRO DFI Lanparty UT Sli-DR Expert nforce4 4400+ X2 2xgb g.skill performance 2x 320gb seagate raid0 700watt ocz psu 8800
-
I can't download any music from my cd's or my computer manually this is the second ipod classic apple sent to me and i have the same problem i am thinking about asking apple for my $319.00 back i am fedup.
-
TREX creation process fails - directory name is invalid
Hello All, I've installed a TREX instance to be linked up to two SRM instances (SRD and SRT). I had done this successfully on a prior server, but recently we got a new server to run TREX on. When I reinstalled TREX on the new server, I have success
-
CS4, Windows 7 (64bit) & Novell
A new Install of CS4 InDesign on a new Windows 7 (64bit) Enterprise desktop, running Novell directory. Files open fine in preview mode, then a few seconds later the file link is broken and the file temporarily gets a modify date of 31st December 199