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