Getting windows domain login name into java application

Hi,
I am looking how can i get user name of windows logged in user. I want to display the user name in the welcome message of the application. The user will be logging into the domain. Please note that I need windows logged in client user name.
Please give suggestions or any direction on this.
Thanks

Thanks a lot for your prompt response.
I tried the example. It works really great from the command prompt.
How do I integrate with application.
My application runs on OC4J server. I hope I need to change the java security.policy file or something to point to my application sepecific policy file (i.e. in the example, the file that we give thru command line).
Not sure.
If possible can you give me some idea on how to change these policy files.
I know I am asking too much, but please help me in this.
Thanks

Similar Messages

  • How to get windows XP login name in SAP.

    I want get windows XP login name in SAP,  which funcion module can  and How method can, thanks.

    hi,
    GUI_GET_DESKTOP_INFO – Returns information about the end-users desktop
    TH_USER_INFO – Returns information about user
    Try this FM, not sure if it return windown user name....give it a try.
    Hope this helps, Do reward.
    Edited by: Runal Singh on Mar 27, 2008 4:16 PM

  • Get windows domain name

    Hi
    How can i get windows domain name after user has been authenticated using ServletAuthentication.login method?
    JDev 11.1.2.3
    Thanks

    The ADF Security Context doesn't provide this kind of information (neither through EL nor through java), so I guess you have to a bit more there.
    A couple of blogs that might help:
    http://one-size-doesnt-fit-all.blogspot.com/2009/01/configuring-jdev-11g-adf-security-app.html
    http://adfhowto.blogspot.com/2011/07/how-to-configure-active-directory.html
    Timo

  • Capture a user's window 2000 login name

    How can I capture a Windows 2000 login name from within a JSP or an applet or, better still, from some other code running on the application server from which they're downloaded?

    http://java.sun.com/docs/books/tutorial/essential/system/properties.html

  • Capture a user's Windows 2000 login name

    How can I capture a Windows 2000 login name from within a JSP or an applet or, better still, from some other code running on the application server from which they're downloaded?

    mgulesian, you might want to query the system properties.
    System.getProperty("user.name")Please note that this property is subject of security constraints (and there're good reasons for this, read the Java Tutorial, Trail: Essential Java Classes, Lesson: Accessing System Resources for details). For example, web applications running inside Tomcat are not allowed to query this property by default. Think twice before doing this, you have been warned!
    HTH, Markus

  • How to get the current function name in java

    How to get the current function name in java.
    In c it is done as
    printf("%s",__func__);
    Thanx in advance.

    j0o wrote:
    System.out.println("Class Name: " + new Exception().getStackTrace()[0].getClassName() +
    "/n Method Name : " + new Exception().getStackTrace()[0].getMethodName() +
    "/n Line number : " + new Exception().getStackTrace()[0].getLineNumber());
    I pointed the OP at this approach yesterday in one of his multi-posts. I still have not been given my Dukes!

  • How do i show vbscript into java application?

    hi
    how do i show vbscript into java application? ( looks like microsoft frontpage)
    or what is interpreter of vbscript for java ?
    thank you?

    There probibly isn't one.
    vbscript and java are rather different. You are better of opening a vbscript viewer from java as a sperate program.

  • How do i show javascript into  java application?

    hi
    ( please help me!!!!!!!!!!!!!!!!!)
    how do i run javascript into java application ?( looks like microsoft frontpage )
    thank you ?

    There is a JavaScript interpreter called Rhino implemented in Java, maybe you can use it: http://www.mozilla.org/rhino/

  • Very slow Windows domain login over IPSec VPN

    Hi
    I'm experiencing very slow Windows domain logins over an IPSec VPN connection. The AD is in Site 1, some users are in Site 2. Two Cisco ASA firewalls connect both sites by an IPSec VPN over the Internet.
    I made some registery changes on the Windows XP client on site2 to let Kerberos communicate over TCP instead of UDP. Still the logins take extremely long (45 minutes). Profiles are very small, so there had to be a problem with Kerberos, MTU sizes or somethin like that. I already changed the clients MTU settings to 1000 byes, but login is still very slow. I made some sniffer logs...
    Does anybody know what the problem can be ?
    Regards
    Remco

    Hi Remco,
    The most common issue with slowness over VPN is going to be fragementation. In general below are the recommendations to avoid fragmentation
    1. For TCP traffic, use "ip tcp adjust-mss 1360" on the Internal LAN Interface on the Router. If you are using GRE then configure "ip mtu 1400" under the Tunnel Interface.
    If you are not using GRE then the value of "ip tcp adjust-mss" depends on the type of transform-set being used E.g. AES\3DES etc, so you can increase the value of TCP adjust command from 1360 to a higher value. Though I will start from 1360 first for testing.
    Also take a look at the below article for MTU Issues
    http://www.cisco.com/en/US/customer/tech/tk827/tk369/technologies_white_paper09186a00800d6979.shtml
    Thanks,
    Naman

  • Get Windows domain name and user through jsp

    I have a jsp page that will be viewed through ie on windows platform, that is a member of domain.
    I need to get the domain name and logged in windows user name to use it in my page.
    I've looked through similar topics. Found no answer.
    1.
    System.parameter("user.name") is not ok. it returns user that runs jvm.
    2.
    import com.sun.security.auth.module.NTSystem;
    NTSystem system = new NTSystem();
    system.getDomain()
    system.getName()that didn't work through jsp, though the answer is correct.
    3. I found some api at http://www.sinotar.com/download/swin/doc/index.html
    it did the right thing, but it's not free.
    Could anyone advice me smth?
    I've looked

    well, it won't work in your jsp because jsps run server-side
    could try putting an applet on your page that does it, but I wouldn't be surprised if the security manager put the kibosh on that, too
    a third - but clunky - way would be to write a quick java app that does it, and launch it through WebStart. bit ugly, and needs extra user input they might not want to do

  • LDAP Windows 2000 Login name

    Hi !
    I use the following code to authenticate users against a Windows 2000 Active Directory.
    My problem is that I have to pass the user name "John Doe" instead of the login name "johndoe" as a parameter.
    How can I achive this ? I know, I have to use a fully qualified name like "johndoe@intranet" but ... ???
    Thankx in advance, Gurus !
    package org.mp.intern;
    import java.util.*;
    import javax.naming.*;
    import javax.naming.directory.*;
    public class LDAPTest
         public void authenticate(String server,String domain,String name,String pwd) throws Exception
              Hashtable env = new Hashtable();
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              env.put(Context.PROVIDER_URL, "ldap://" + server + ":389/dc=" + domain);
              env.put(Context.SECURITY_AUTHENTICATION, "simple");
              env.put(Context.SECURITY_PRINCIPAL, "cn=" + name + ",cn=users,dc=" + domain);
              env.put(Context.SECURITY_CREDENTIALS, pwd);
              DirContext ctx = new InitialDirContext(env);
              ctx.close();
         public static void main(String[] args)
              LDAPTest p = new LDAPTest();
              try
                   // I have to do this ..
                   p.authenticate("pdc","intranet","John Doe","mypassword");
                   // ... but I want to do this
                   p.authenticate("pdc","intranet","johndoe@intranet","mypassword");
              catch(Exception ex)
                   ex.printStackTrace();
    }

    Ok,
    have located the solution on my own.
    simply pass the login name plus the domain name as the SECURITY_PRINCIPAL, for example :
    env.put(Context.SECURITY_PRINCIPAL,userName + "@" + domain);
    Not everything is complicated in a heterogeneus world :-))
    cya

  • Help with Windows Domain Login on Mac

    Hello Everyone,
    We have two Mac Pros at my work running Mac OS 10.5.8 and they are attached to the Windows Server / Domain so when the Mac is turned on you login with your Domain credentials (using Win Server to Authenticate). Now all of this has been working fine since the computers were purchased a year ago, until two days ago that is. I turned on the Mac Pro in the morning and tried to login, and the Mac would freeze and do nothing. I restarted and tried again, using the same credentials I always use, but nothing worked. I called the IT guys and had my windows user account reset thinking that the password was expired, still didn't help, so I asked them to reset the whole account, still didn't help.
    At this point I asked a few of my co-workers to login on my Mac using their login info, and they had no problems at all. I decided to dig deeper into this problem and logging in under a "local" Mac account I went into the "Accounts" preferences to check what was going on, to my surprise my Domain account was visible (normally it wasn't unless you were logged in) and under the account it said "sharing only".
    I am still trying to figure out why my Domain account was changed from "Admin, Managed" to "Sharing Only"? So I decided that the easy fix here was to use a previously made (and tested) image file which I created when the Mac Pro was first setup and all the software was installed. So after cloning the image to the Mac HD I turned on the Mac and tried to login, again nothing happened. I can login using the local account, and my co-workers can login fine, but my domain login just refuses to work. I have also tired to login on other Macs in the department and I can login just fine on each one, the only Mac that doesn't let me login is my machine.
    I have run out of ideas, short of re-installing the entire system from scratch.. which I really don't want to do unless I have to. But if anyone out there has any ideas I would more than welcome them.
    Thanks in advance..

    It's probably related to some type of DRM (copy-protection) on the digital copy, and not due to it being any particular type of file format. The DRM scheme probably only works under Windows. And if that is the case, I don't think you will be able to get it to work under Mac OS X, short of running VMware Fusions or Parallels Desktop (or Sun's free VirtualBox) and installing Windows to run under Mac OS X.
    Considering the popularity of Macs recently, and higher use of Macs among creative folks, it's pretty stupid for the studio/distributor to make a key feature Windows-only.

  • I want to get the usr login name

    hi
    i have a jsp code in which i can get ip of any client in my LAN by the following func
    request.getRemoteAddr()
    but i want the login name of the users which they used to log in into windows.we hv windowsxp installed.and each one is provided wth a uname and password.is this possible in JSP??

    If I understood correctly....
    You may try the below script:
    SET NOCOUNT ON
    DECLARE @Tables table (DbName sysname,SchemaName sysname, TableName sysname, columnName sysname,TypeName sysname)
    DECLARE @SQL nvarchar(4000)
    SET @SQL='select ''?'' as DbName, s.name as SchemaName, t.name as TableName,c.name ,tp.name
    from [?].sys.tables t
    inner join [?].sys.schemas s on t.schema_id=s.schema_id
    Inner join [?].sys.columns c on t.object_id = c.object_id
    Inner Join [?].sys.types Tp on tp.system_type_id = c.system_type_id where t.object_id=' + cast(427916646 as varchar(100))
    INSERT INTO @Tables (DbName, SchemaName, TableName,columnName,TypeName)
    EXEC sp_msforeachdb @SQL
    SET NOCOUNT OFF
    SELECT * FROM @Tables ORDER BY DbName, SchemaName, TableName
    Ref: http://gallery.technet.microsoft.com/Find-SchemaTableColumn-and-13506d80

  • Windows Domain login and timer

    We are binding several Macs to the windows domain here.  That really hasnt been an issue, we used Centrify Express, and that went fine.  Users can log into the domain no problem.  All the Macs were built with a service account (UID svc-account) similar to an admin account on windows.  Any user can sit down at a Mac and if they enter good domain credentials they get logged in.
    But when a mac is first powered on, and gets to the login screen, the svc-account is first presented, then after about 10 sec, a little arrow appears.  by clicking on the arrow, you can choose "other user" and log in with domain credentials.  Is there a way to shorten this timer, or default to "other user", or default to any domain user account?

    We are binding several Macs to the windows domain here.  That really hasnt been an issue, we used Centrify Express, and that went fine.  Users can log into the domain no problem.  All the Macs were built with a service account (UID svc-account) similar to an admin account on windows.  Any user can sit down at a Mac and if they enter good domain credentials they get logged in.
    But when a mac is first powered on, and gets to the login screen, the svc-account is first presented, then after about 10 sec, a little arrow appears.  by clicking on the arrow, you can choose "other user" and log in with domain credentials.  Is there a way to shorten this timer, or default to "other user", or default to any domain user account?

  • Import tool into java application.

    I'm creating a java web service & would like to know if there is a way to import a .exe file into the application so that it can be used in windows with having to be on the customers machine.

    I'm sorry, you're firmly in WTF territory here.
    That's a command to load an application via Java Web Start. It loads it from the server at 192.168.1.1. Running a Web Start application, once it's loaded onto the client, does not involve a browser. But getting it installed on the client does involve a browser.
    And you can configure a Web Start application to create a shortcut. You don't need to do it yourself, least of all from the application to which the shortcut should refer.
    I also don't understand the reference to "web services" and "turning the application into a web application", but probably your use of those phrases isn't related to their actual standard meanings.
    My advice: use Java Web Start in the way it was meant to be used. It works just fine that way. Don't try to help it out if you don't know what you are doing. Which you definitely don't, if I am understanding your idea correctly. Which I might not be.

Maybe you are looking for

  • Accessing The Names in the Data Neighborhood From Within Visual Basic

    I would like to have my application get the names that are listed in the Measurement & Automation Data Neighborhood.

  • Copying Standard SAPScript to ZSapscript...

    Hi, I want to copy standard sapscript to zsapscript. I go in SE71 and enter the name of Z sapascript form and then create. Now when I go to Menu-> Form-> copy from: I give form name as MR_PRINT and give language as EN. It says MR_PRINT LANGUAGE EN is

  • Approval of AR with out workflow

    Hi frineds We are using IM/PS. AR is created and follows the approval process. Here we have no work flow. Now how the approval process can be followed. I am aware that we can use the partner determination procedure but unable to go ahead. As per the

  • Store integer list in Windows Phone Memory

    Hi! I need to store a list of integer values in the Windows Phone (8.1) memory, preferrably using the Windows.Storage namespace as an ApplicationData.LocalSettings. How may I acheive this? I tried doing the following to create a new List<int> out of

  • Use iDVD to author .exe Games?

    I have searched the Apple/iDVD forums and found nothing on this topic. Do you know if it is possible to use iDVD 5 to author a DVD of executable [.exe] game files? I would like to put several childrens games on one DVD. Set up the menu to go to the v