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

Reply via email to