1 /**
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20 package org.apache.wss4j.common.spnego;
21
22 import java.security.PrivilegedAction;
23
24 import org.ietf.jgss.GSSContext;
25
26 /**
27 * This interface represents a PrivilegedAction implementation to obtain a (SPNEGO) service ticket
28 * from a Kerberos Key Distribution Center.
29 */
30 public interface SpnegoClientAction extends PrivilegedAction<byte[]> {
31
32 /**
33 * Whether to enable mutual authentication or not.
34 */
35 void setMutualAuth(boolean mutualAuthentication);
36
37 /**
38 * The Service Name
39 */
40 void setServiceName(String serviceName);
41
42 /**
43 * If true - sets the SPN form to "username"
44 * <br/>If false<b>(default)</b> - the SPN form is "hostbased"
45 *
46 * @param isUsernameServiceNameForm the isUsernameServiceNameForm to set
47 */
48 void setUserNameServiceForm(boolean isUsernameServiceNameForm);
49
50 /**
51 * Obtain a service ticket
52 */
53 byte[] run();
54
55 /**
56 * Get the GSSContext that was created after a service ticket was obtained
57 */
58 GSSContext getContext();
59
60 }