Pier,
Thanks for this very useful utility. It appears WebSphere is adding by default some 
additional authentication scheme. Which I'll have to make use of, or disable. I 
appreciate your help.

Here are the returned HTTP headers.

HTTP/1.1 401 ok
Server: Microsoft-IIS/4.0
Date: Mon, 11 Dec 2000 17:02:15 GMT
WWW-Authenticate: NTLM
content-type:text/html
WWW-Authenticate:BASIC realm="New Business"

-----Original Message-----
From: Pier P. Fumagalli [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 11, 2000 8:17 AM
To: [EMAIL PROTECTED]
Subject: Re: Realms


Lindsay, William (BIS) <[EMAIL PROTECTED]> wrote:

> If I send an HTTP header ("WWW-Authenticate", "BASIC
> realm=\"privileged-few\"") from a Sun Servlet Container the client browser
> knows how to prompt authenticatation for that REALM "privileged few". If I
> send the same HTTP Header from Websphere I get a DOMAIN prompt with no
> reference to "Priviledged Few".
>
> What could be happening here ?
>
> Thanks
>
> Bill Lindsay - Merrill Lynch

I wrote a stupid java class to test out headers on an HTTP connection, you
might want to run it using your url on WebSphere, and post me, or to the
list, the results... It does really depend on what headers WebSphere is
sending back.

  Pier

-- CUT HERE --------------------------------
import java.io.*;
import java.net.*;

public class HttpTest {

  private static String MESSAGE=
      "Usage: java HttpTest http://host:port/url";

  public static void main(String argv[])
  throws IOException {
      if (argv.length!=1) {
          System.err.println(MESSAGE);
          return;
      }

      URL url=null;
      try {
          url=new URL(argv[0]);
      } catch (IOException e) {
          System.err.println(MESSAGE);
          return;
      }

      String host=url.getHost();
      int port=url.getPort();
      String file=url.getFile();

      if (host==null) host="localhost";
      if (port<=0) port=80;
      if (file==null) file="/";

      Socket sock=new Socket(host,port);
      PrintStream out=new PrintStream(sock.getOutputStream());
      InputStream in=sock.getInputStream();

      out.print("GET "+file+" HTTP/1.0\r\n");
      out.print("Host: "+host+":"+port+"\r\n");
      out.print("Connection: close\r\n");
      out.print("Accept: */*\r\n");
      out.print("User-Agent: Mozilla/4.0 (compatible; HttpTest 1.0)\r\n");
      out.print("\r\n");
      out.flush();
      int data=-1;
      while ((data=in.read())!=-1) {
          System.out.write(data);
      }
      sock.close();
  }
}
-- CUT HERE --------------------------------
--
Pier Fumagalli - Sun Microsystems Inc. - <mailto:[EMAIL PROTECTED]>
----------------------------------------------------------------------------

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to