HttpNegotiateServer.java revision 3388
2362N/A * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 1266N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1266N/A * This code is free software; you can redistribute it and/or modify it 1266N/A * under the terms of the GNU General Public License version 2 only, as 1266N/A * published by the Free Software Foundation. 1266N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1266N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1266N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1266N/A * version 2 for more details (a copy is included in the LICENSE file that 1266N/A * You should have received a copy of the GNU General Public License version 1266N/A * 2 along with this work; if not, write to the Free Software Foundation, 1266N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 1266N/A * @summary Undefined requesting URL in java.net.Authenticator.getPasswordAuthentication() 1266N/A * Basic JGSS/krb5 test with 3 parties: client, server, backend server. Each 1266N/A * party uses JAAS login to get subjects and executes JGSS calls using 1266N/A // Two realm, web server in one, proxy server in another 2233N/A // For 6829283, count how many times the Authenticator is called. 1266N/A // URLs for web test, proxy test. The proxy server is not a real proxy 1266N/A // since it fakes the same content for any URL. :) 1266N/A * This Authenticator checks everything: 1266N/A * scheme, protocol, requestor type, host, port, and url 2233N/A * This Authenticator knows nothing 2233N/A // Write a customized JAAS conf file, so that any kinit cache 2233N/A " com.sun.security.auth.module.Krb5LoginModule required;\n};\n" 1266N/A // Must stop. Seems there's no HttpServer.startAsDaemon() 2233N/A // Will fail since no username and password is provided. 1266N/A * Creates and starts an HTTP or proxy server that requires 1266N/A * Negotiate authentication. 1266N/A * @param scheme "Negotiate" or "Kerberos" 1266N/A * @param principal the krb5 service principal the server runs with 1266N/A // The GSContext is stored in an HttpContext attribute named 1266N/A // "GSSContext" and is created at the first request.