Get Users windows Domain name

Hi,
Is it possible to retrieve users windows Domain directly using Java or there is any other alternative to retrieve this.
Regards,
Manda

warnerja wrote:
And rightfully so. What do you suppose a platform-independent language like Java should report as the "Windows Domain" when the app is run on Linux or Mac, for example?
You should not "need" to know the user's "Windows Domain". If you think you need to know this, you are highly likely developing something backwards, or are using the wrong tool for the job.I'm sorry, but this is a dumb answer to a real question. Real world applications almost ALWAYS need access to system level functionality. When it comes to security domain related applications or services, any application or service that doesn't need this information is not worth having. We write in Java for portability, but when we need to access system-level information, we use JNI calls to do so. Java bigots tend to think the only operating system is the JVM, but real world engineers know that the JVM is only a means to an end -- portability and clean code.
This problem can be solved by using the JAAS com.sun.security.auth.module.NTSystem and com.sun.security.auth.module.UnixSystem classes. It should be noted that Sun recommends against using these classes directly, but in the same act, they don't expose the functionality they provide though the public JAAS interfaces either (which leads one to wonder why they even exist, because they're not used in lower-level JAAS code either, as far as I can tell).
I can only guess that Sun provided them in JAAS because people have screamed for them, and JAAS seemed like the most appropriate place to provide them. At the same time, Sun (unrealistically) doesn't like to believe that anything beyond the JVM is needed in an application or service, so they don't provide any "use" documentation for them either in the class javadoc.
Some caveats regarding these classes: Each of these classes is only available on the system for which they are intended by default. That is, you won't find a jaas_nt.dll on any Unix system JVM, and you won't find a jaas_unix.so native library on NT. Thus, to write portable code (at least to Windows and various Unix variants), you need to use reflection to access them. Fortunately, the methods of these classes are trivial, returning strings or longs.
Good luck!

Similar Messages

  • How to get localcomputer network  domain name?

    HI all
       Does any one know how to get  localcomputer's network domain name !  I call use function to get  local computername in sap system! But I could not find any functions to get network domain !

    Below link may be useful, check reply from Poornanand.
    Get user system domain name ?

  • 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

  • Problem getting a DDNS Domain name

    I can not get the DDNS domain name feature to work. I get a message that says user name already being used. I have tried numerous versions of names and get the same message. I can go to someplace outside my network and connect using the ip address but I would like to set up a DDNS name.

    I can not get the DDNS domain name feature to work. I get a message that says user name already being used. I have tried numerous versions of names and get the same message. I can go to someplace outside my network and connect using the ip address but I would like to set up a DDNS name.

  • How to Use 'uid' for AD Users Without Domain Name For User Log in OAM

    How to Use 'uid' for synchronized Active Directory (AD) Users into Oracle Internet Directory (OID) Without Domain Name For User Logins in OIDDAS and OAM
    We successfully integrated OAM 11g with EBS R12.1.3 Now all the AD user id's stored in fnd_users table as [email protected]
    How can we remove @abc.com
    We are using OID 11g and OAM 11g
    Found the similar note for OID 10G: How to Use 'uid' for AD Users Without Domain Name For User Logins in OIDDAS and SSO [ID 580480.1]
    We are in OID 11g.
    Any help on this greatly appreciated.

    I couldn't find any reference that could be helpful -- Please log a SR and see if this is supported and if the steps are available.
    Thanks,
    Hussein

  • Can't seem to get my own domain name to work

    First of all I'm sure this has been asked a lot so apologies if it's a repetitive post I'm just at the hair pulling stage!
    Well. I've had no issues joining mobile me (joined a week ago) and publishing my site from iWeb.
    But then I wanted to get my own domain name.
    (i got it from 123-reg.co.uk just in case that is is anyway significant.)
    This is where my question becomes a bit "Balloon" shaped.
    When setting my CName on 123-reg I was asked to enter info into two boxes. (That seemed to tally with the help files I have read.)
    I entered web.me.com into the first box and my domain name into the second. I'll just call it for now www.mywebsite.co.uk
    Then it asked me to enter my website IP which I located by using one of those pages you can type a domain into and it searches...
    Sorry if this is dumb but does that sound about right?
    Some questions-
    -Is it correct to put www.mywebsite.co.uk as well as web.me.com or should it be something else?
    -Would there be any mobile-me issues while I'm still on the free trial?
    -Are some domain name providers incompatible with mobile-me?
    -And if I change the CName with the registrar should I delete and reconfigure myown domain in my mobile me-account?
    If anyone could enlighten me they would basically be my new hero!
    Thanks.

    Oh one more thing..
    When asked for the IP of your website does that mean the IP of your own website or the host (being Mobileme of course? i.e. the IP of www.web.me.com/mywebsitetemporaryname or me.com?

  • Regarding addressFormular, How to get user's First Name & Last Name?

    Hi,
    I am trying to get user's first name & last name through
    AddressFormular addressFormular = (AddressFormular) request.getAttribute(ActionConstants.RC_ADDRESS_FORMULAR);
    addressFormular.getAddress().getFirstName();
    as it is shown in addresschange.jsp file. It doesn't work.
    Any ideas about addressFormular?
    Is there any other place to get user's first name & last name?
    Thanks,
    Harsha

    Hi,
    In Email Definition you can select required field values from Variables section.
    For example: User Profile Information and then select User Login.
    Thanks,
    Pallavi

  • Get rid of domain name

    Hi all,
    How to get rid of domain name from global_name?
    db_name = test
    db_domain =
    select * from global_name
    global_name
    test.oracle.com
    Is there any parameter to set so that only "test" will be displayed in global_name not "test.oracle.com"?

    Try:
    db_domain="" ;
    edit the network files:
    sqlnet.ora - delete the entry for the default domain
    tnsnames an listener : edit the service_name
    Cheers,
    Dobby

  • 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

  • Getting list of domain names on NT, and authenticating user

    Hello, I want to make an class that will check the user login name and password on a NT domain, the class will show a screen with 2 fields, username and password, and a combobox, with all domain names, on this screen the user will type his username and password and choose a domain to login to, the class will then check if he can login to that domain.
    Currently the problem I have is that I couldn�t find a way to get a list of domain names.
    And after I get that list, what is the best way to authenticate the user ?
    Thanks a lot in advance for any help.

    hi,
    you can ask for username, password by running this code:
    String auth = httpRequest.getHeader("Authorization");
    if (auth == null)
    httpResponse.setStatus(httpResponse.SC_UNAUTHORIZED);
    httpResponse.setHeader("WWW-Authenticate", "NTLM");
    httpResponse.flushBuffer();
    return;
    if (auth.startsWith("NTLM "))
    byte[] msg = new sun.misc.BASE64Decoder().decodeBuffer(auth.substring(5));
    int off = 0, length, offset;
    if (msg[8] == 1)
    byte z = 0;
    byte[] msg1 = {(byte)'N', (byte)'T', (byte)'L', (byte)'M', (byte)'S', (byte)'S', (byte)'P',
    z,(byte)2, z, z, z, z, z, z, z,(byte)40, z, z, z,
    (byte)1, (byte)130, z, z,z, (byte)2, (byte)2,
    (byte)2, z, z, z, z, z, z, z, z, z, z, z, z};
    httpResponse.setHeader("WWW-Authenticate", "NTLM " +
    new sun.misc.BASE64Encoder().encodeBuffer(msg1));
    httpResponse.sendError(httpResponse.SC_UNAUTHORIZED);
    return;
    else if (msg[8] == 3)
    off = 30;
    length = msg[off+17]*256 + msg[off+16];
    offset = msg[off+19]*256 + msg[off+18];
    String remoteHost = new String(msg, offset, length);
    length = msg[off+1]*256 + msg[off];
    offset = msg[off+3]*256 + msg[off+2];
    String domain = new String(msg, offset, length);
    length = msg[off+9]*256 + msg[off+8];
    offset = msg[off+11]*256 + msg[off+10];
    String username = new String(msg, offset, length);
    You can put this code in youe servlet or in a filter.
    I am also strucked with similar problem.
    With this code i am getting the window to enter loginId/password but i am not able to authenticate it.
    If you have found any solution to authenticate the user please help me.
    i am really strucked.
    thanks in advance
    Pamjoshua

  • Detecting user and domain name

    I am developing an application that will have an autologin option based on OS current logged user.
    How do I determine what the domain name is in Windows?
    Thanks

    This link has the native windows code to retreive domain name:
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;111544
    Use JNI.

  • How do you get a new domain name?

    I know it must be very simple to do but I just can't understand this process.
    Do you have to buy a domain name from places like godaddy.com first?
    Or can you created it on MobileMe for free?
    Does it take 48hours to take effect?
    Thanks

    All domain names must be purchased from an domain name provider. GoDaddy.com is just one of many providers.
    Once you purchase your name and publish the site you can set up MobileMe to use that domain name in one of two ways:
    1 - using the CNAME feature of MobileMe. These documents describes how it is done:
    http://docs.info.apple.com/article.html?path=MobileMe/Account/en/acct17114.html
    http://help.godaddy.com/article/4100
    2 - using the regular domain name forwarding like this example thru GoDaddy.com (this assumes you purchase the name thru GoDaddy) as seen in this screenshot:
    Click to view full size
    OT

  • How do I find out user and domain names in WL7.0 security

    Hi,
    I'm moving to WL7.0 security and now weblogic.security.acl.Security.getCurrentUser()
    that worked in CompatibilityMode throws NullPointerException. What is the alternative
    to deprecated weblogic.security.acl.Security in the new Weblogic security framework?
    Also, how can I find the current domain name?
    Thanks,
    Michael.

    "Michael Bogomolov" <[email protected]> wrote in message
    news:3ec515ae$[email protected]..
    >
    Hi,
    I'm moving to WL7.0 security and nowweblogic.security.acl.Security.getCurrentUser()
    that worked in CompatibilityMode throws NullPointerException. What is thealternative
    to deprecated weblogic.security.acl.Security in the new Weblogic securityframework?
    >
    See getCurrentSubject in
    http://e-docs.bea.com/wls/docs81/javadocs/weblogic/security/Security.html
    getCurrentUser only works in compatibilty mode

  • Occasionally get "Security Error: Domain Name Mismatch"

    When logging in to these discussions from the PC at work (XP Pro SP2), and using Firefox 1.5, I sometimes get a Security Error notice that reads:
    "You have attempted to establish a connection with "metrics.apple.com". However, the security certificate presented belongs to "*.112.2o7.net". It is possible, though unlikely, that someone may be trying to intercept your communication with this website. If you suspect the certificate shown does not belong to "metrics.apple.com", please cancel the connection and notify the site administrator."
    On the security certificate, it says *.112.2o7.net is issued to Omniture, Inc.
    Is this something I should be concerned about?

    Hi Roger --
    You might find this thread interesting: http://discussions.apple.com/thread.jspa?messageID=2508187&#2508187
    -- JDee

  • Lync 2013 /w Edge not working properly (internal/external same domain name and all "external" users"

    Hi,
    I've got some issues with a Lync 2013 setup.
    The config consists of 2 lync servers. One FE and one Edge. All seems to work except audio in meetings and Sip.
    The setup is like this (fake ip's used):
    Front End:
    Internal IP: 172.16.0.10
    External IP: x.x.185.10
    All ports open in Cisco ASA
    internal AD DNS: dialin/lync/meet/lyncdiscover to Front end internal ip. edge/lsedge/sip points to edge internal ip
    EDGE:
    Interal IP: 172.16.0.11 (no gateway configured)
    External IPS: x.x.185.11, x.x.185.12, x.x.185.13
    All external IP's are direct internet facing, no NAT (a firewall is in place).
    All external interfaces are using a wildcard certificate.
    All server are running in a remote data center, so basically no internal users. We all connect to the external interfaces. The Windows domain name (AD) is the same as our External DNS (companyname.com).
    Autodiscover works, we can logon, chat but there is no audio. The audio test failes. Also SIP is not working with a sip trunk.
    External DNS: sip/webconf/av are pointing to their external ip's. sipexternal is a cname to sip. lyncdiscover/lync/dialin/meet all point to the Frond end External ip.
    _sip._tls/_sipfederationtls.tcp/_xmpp-server.tcp all point to the sip.companyname.com ip.
    I just can't figure out what is wrong.

    @PSingh123 I'll try the logs in a minute and get back with the results.
    @PaulB_NZ Thanks for the input. In my opinion the FE does need an external IP. How else will you be able to connect if you are a remote worker?
    The Edge is (asfar as i know) needed for Enterprise voice and Federation with other (external) sip domains. It's not needed for basic (chat/video/whiteboard etc) Lync functionality for both internal and external (remote) users.
    The Edge is to communicate with services/users outside the origanisation.
    I do still think that the basic topology (FE with internal IP and Nat'ed external ip working with an Edge with internal IP and 1 external IP nat'ed to 3 DMZ ip's) is correct in this case.
    I can be wrong and in that case would like to be pointed to the correct configuration.
    75           
    Points
    Top 15
    PSingh123        
    Partner        
    Joined  Jun 2007        
    9
    PSingh123's threads
    Show activity

Maybe you are looking for