OkAsDelegateXRealm.java revision 2362
0N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * @param args boolean if the program should succeed // Create and start the KDCs. Here we have 3 realms: R1, R2 and R3. // R1 is trusted by R2, and R2 trusted by R3. // Defines the client and server on R1 and R3 respectively. " com.sun.security.auth.module.Krb5LoginModule\n" +
" useTicketCache=false\n" +
"com.sun.security.jgss.krb5.accept {\n" +
" com.sun.security.auth.module.Krb5LoginModule required\n" +
" keyTab=localkdc.ktab\n" +
" storeKey=true;\n};\n" +
// Test twice. The frist time the whole cross realm process is tried, // the second time the cached service ticket is used. This is to make sure // the behaviors are the same, especailly for the case when one of the // cross-realm TGTs does not have OK-AS-DELEGATE on. for (
int i=
0; i<
2; i++) {
throw new Exception(
"Test fail at round #" + i);