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

Similar Messages

  • 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?

  • 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 get list of file names from a directory?

    How to get list of file names from a directory?
    Please help

    In addition, this:
    String filename = files;Should be this:
    String filename = files;
    That's just because he didn't use the "code" tags, so [ i ] made everything following it become italicized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to get List Item attachments name without write any custom code or any database query?

    Hi,
    How to get List Items attachments name without write any custom code or any database query?

    You can get it from Rest,
    There are 2 options,
    1) create a 'Result Source' which has a search query for that List which has attachments 
     - Use rest query to get the 'Filename' , it will have the attachment file name 
    For example, if the result source id is : 73e6b573-abf8-4407-9e5f-8a85a4a95159 , then the query will be 
    http://[site URL]/_api/search/query?querytext='*'&selectproperties='Title,Path,FileExtension,SecondaryFileExtension,Filename'&sourceid='73e6b573-abf8-4407-9e5f-8a85a4a95159'&startrow=0&rowLimit=100
    You can refine the query, be giving proper 'querytext'
    2) Use the List rest api
    For example if your list guid is :38d524a1-e95c-439f-befd-9ede6ecd242e
    You can get he attachments for 1st item using this 
    http://[Site URL]/_api/lists(guid'38d524a1-e95c-439f-befd-9ede6ecd242e')/items(1)/AttachmentFiles
    get2pallav
    Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

  • 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

  • I have two location one is Delhi(IP-192.168.100.*) and another is Mumbai(IP-192.168.1.*) and both are connected by MPLS line and ping with each other. We have one DC in Delhi location and domain name is CAPLDC and Delhi location all PC is member of this

    I have two location one is Delhi(IP-192.168.100.*) and another is Mumbai(IP-192.168.1.*) and both are connected by MPLS line and ping with each other.
    We have one DC in Delhi location and domain name is CAPLDC and Delhi location all PC is member of this domain and working properly.
    now i am trying join the Mumbai location PC with my Domain(CAPLDC) but they are not join with my DC and generate the error.
    I have chek the DNS and nslookup all are correct but this is generate error. 
     Is this possible Mumbai location join with this Domain(CAPLDC)???
    One more thing when i have created another DC with this name (papldc.com) then Mumbai location is joined properly.
    Pls find the error message below and also find the attachment.
    Note: This information is intended for a network administrator.  If you are not your network's administrator, notify the administrator that you received this information, which has been recorded in the file C:\Windows\debug\dcdiag.txt.
    The domain name "capldc" might be a NetBIOS domain name.  If this is the case, verify that the domain name is properly registered with WINS.
    If you are certain that the name is not a NetBIOS domain name, then the following information can help you troubleshoot your DNS configuration.
    DNS was successfully queried for the service location (SRV) resource record used to locate a domain controller for domain "capldc":
    The query was for the SRV record for _ldap._tcp.dc._msdcs.capldc
    The following domain controllers were identified by the query:
    capldcserver.capldc
    win-dyfq2poc88q.capldc
    However no domain controllers could be contacted.
    Common causes of this error include:
    - Host (A) or (AAAA) records that map the names of the domain controllers to their IP addresses are missing or contain incorrect addresses.
    - Domain controllers registered in DNS are not connected to the network or are not running.
    Pankaj Kumar

    Why are you using a single labeled domain? I would recommend renaming the domain name to be something like domain.com.
    Please refer to the articles below to fix your current issue:
    http://www.wincert.net/tips/networking/1614-cant-join-pc-to-a-domain-with-single-label.html
    http://www.itgeared.com/articles/1128-using-single-label-dns-names-for-active/
    This posting is provided AS IS with no warranties or guarantees , and confers no rights.
    Ahmed MALEK
    My Website Link
    My Linkedin Profile
    My MVP Profile

  • When I select an album to play the first song gets listed many many times on upnext and is the onyl one to play..help

    When I select an album to play the first song gets listed many many times on upnext and is the only one to play..help

    Figured it out.. Had the repeat set to 1...so it lists the first song multiple times....

  • Using a domain name with .mac and iWeb

    How does one go about linking a domain name to the iWeb pages/ .mac account?
    In other words, I don't want to have to give out the long web.mac.com/blahblahblah/site
    name, I'd like to just have a domain name.

    Dottonedan...
    I have replied to your thread over here...
    http://discussions.apple.com/thread.jspa?threadID=647660&tstart=0
    You might want to have a look at the public DNS service that I posted about.
    What you are looking for is basically a domain name server that will accept your domain name and be able to translate the words into the numbers like you mention. That's what DNS servers do. There are LOTS of DNS servers on the internet and once you get your domain name hooked into one the information will propagate within days if not hours, making your domain name functional.
    Anyways, look back at the thread you started and you'll see my post there... we'll start there and get you squared away sooner or later, i'm sure.

  • 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

  • Getting list of document name in a container

    Hi,
    I am trying to get list of all document names in a container using the following code in PHP:
    http://dpaste.com/25409/
    but I am getting an error as listed in the above link.
    Any idea? I searched on Google but couldnt get any definitive answer.
    Thanks.

    Hello,
    Try:
    for $doc in collection() return dbxml:metadata('dbxml:name',$doc)
    Regards,
    George

  • 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 ?

  • Domain name with DNS and VPN query

    When inside our VPN network computers dont recognise the domain name and have to use the direct IP address of the server to access services. Is that normal? Outside the domain works fine. In my Zone settings the machine IP address is the actual server IP. Should it be resolving to the VPN router's IP?

    Please explain your setup a bit further.
    What machine/router (gw) is doing VPN and what machine is doing DNS?
    If the LAN is using private IPs, VPN clients and LAN clients should be using only the same private IP DNS. Public IP DNS doesn't know about your private IP network.

  • Info needed on how to get list price for a given MATNR and pricing Conditio

    Hi All,
    Can some one help me in finding List price for a given MATNR and pricing condition type.
    Basically, i need info regarding the tables that i need to use for this purpose.
    Thanks in advance.
    Regards,
    Udaya.
    PS: All helpful answers will be rewarded.

    Hi Udaya,
    A simple solution to all these kind of problems:
    Goto  Transation SE16
    Table :TSTC
    in Tcode :Give A* or V*  or anything...and find the relevant transctions and data.
    if found useful...reward points.
    Regards,
    Nisha

  • Info needed on how to get list price for a given MATNR and pricing Conditi

    Hi All,
    Can some one help me in finding List price for a given MATNR and pricing condition type.
    Basically, i need info regarding the tables that i need to use for this purpose.
    Thanks in advance.
    Regards,
    Udaya.
    PS: All helpful answers will be rewarded.

    Hi,
    I moved your topic to this forum
    Mario

Maybe you are looking for