Class KerberosSecurity
java.lang.Object
org.apache.wss4j.common.token.BinarySecurity
org.apache.wss4j.dom.message.token.KerberosSecurity
public class KerberosSecurity
extends org.apache.wss4j.common.token.BinarySecurity
Kerberos Security Token.
-
Field Summary
Fields inherited from class org.apache.wss4j.common.token.BinarySecurity
TOKEN_BST, TOKEN_KI -
Constructor Summary
ConstructorsConstructorDescriptionKerberosSecurity(Document doc) This constructor creates a new Kerberos element.KerberosSecurity(Element elem, org.apache.wss4j.common.bsp.BSPEnforcer bspEnforcer) This constructor creates a new Kerberos token object and initializes it from the data contained in the element. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddecorateSubject(Subject subject) booleanGet the SecretKey associated with the service principalinthashCode()booleanReturn true if this token is a Kerberos GSS V5 AP REQ tokenstatic booleanisKerberosToken(String valueType) Return true if the valueType represents a Kerberos TokenbooleanReturn true if this token is a Kerberos V5 AP REQ tokenvoidretrieveServiceTicket(String jaasLoginModuleName, CallbackHandler callbackHandler, String serviceName) Retrieve a service ticket from a KDC using the Kerberos JAAS module, and set it in this BinarySecurityToken.voidretrieveServiceTicket(String jaasLoginModuleName, CallbackHandler callbackHandler, String serviceName, boolean isUsernameServiceNameForm) voidretrieveServiceTicket(String jaasLoginModuleName, CallbackHandler callbackHandler, String serviceName, boolean isUsernameServiceNameForm, boolean requestCredDeleg) voidretrieveServiceTicket(String jaasLoginModuleName, CallbackHandler callbackHandler, String serviceName, boolean isUsernameServiceNameForm, boolean requestCredDeleg, GSSCredential delegatedCredential) voidretrieveServiceTicket(CallbackHandler callbackHandler) Retrieve a service ticket from a KDC using the Kerberos JAAS module, and set it in this BinarySecurityToken.Methods inherited from class org.apache.wss4j.common.token.BinarySecurity
addWSSENamespace, addWSUNamespace, encodeRawToken, getAttachmentCallbackHandler, getElement, getEncodingType, getID, getToken, getValueType, isStoreBytesInAttachment, setAttachmentCallbackHandler, setEncodingType, setID, setRawToken, setStoreBytesInAttachment, setToken, setValueType, toString
-
Constructor Details
-
KerberosSecurity
public KerberosSecurity(Element elem, org.apache.wss4j.common.bsp.BSPEnforcer bspEnforcer) throws org.apache.wss4j.common.ext.WSSecurityException This constructor creates a new Kerberos token object and initializes it from the data contained in the element.- Parameters:
elem- the element containing the Kerberos token databspEnforcer- a BSPEnforcer instance to enforce BSP rules- Throws:
org.apache.wss4j.common.ext.WSSecurityException
-
KerberosSecurity
This constructor creates a new Kerberos element.- Parameters:
doc-
-
-
Method Details
-
isV5ApReq
public boolean isV5ApReq()Return true if this token is a Kerberos V5 AP REQ token -
isGssV5ApReq
public boolean isGssV5ApReq()Return true if this token is a Kerberos GSS V5 AP REQ token -
retrieveServiceTicket
public void retrieveServiceTicket(CallbackHandler callbackHandler) throws org.apache.wss4j.common.ext.WSSecurityException Retrieve a service ticket from a KDC using the Kerberos JAAS module, and set it in this BinarySecurityToken.- Parameters:
callbackHandler- a CallbackHandler instance to retrieve a password (optional), JAAS Login Module name (required) + service name (required)- Throws:
org.apache.wss4j.common.ext.WSSecurityException
-
retrieveServiceTicket
public void retrieveServiceTicket(String jaasLoginModuleName, CallbackHandler callbackHandler, String serviceName) throws org.apache.wss4j.common.ext.WSSecurityException Retrieve a service ticket from a KDC using the Kerberos JAAS module, and set it in this BinarySecurityToken.- Parameters:
jaasLoginModuleName- the JAAS Login Module name to usecallbackHandler- a CallbackHandler instance to retrieve a password (optional)serviceName- the desired Kerberized service- Throws:
org.apache.wss4j.common.ext.WSSecurityException
-
retrieveServiceTicket
public void retrieveServiceTicket(String jaasLoginModuleName, CallbackHandler callbackHandler, String serviceName, boolean isUsernameServiceNameForm) throws org.apache.wss4j.common.ext.WSSecurityException - Throws:
org.apache.wss4j.common.ext.WSSecurityException
-
retrieveServiceTicket
public void retrieveServiceTicket(String jaasLoginModuleName, CallbackHandler callbackHandler, String serviceName, boolean isUsernameServiceNameForm, boolean requestCredDeleg) throws org.apache.wss4j.common.ext.WSSecurityException - Throws:
org.apache.wss4j.common.ext.WSSecurityException
-
retrieveServiceTicket
public void retrieveServiceTicket(String jaasLoginModuleName, CallbackHandler callbackHandler, String serviceName, boolean isUsernameServiceNameForm, boolean requestCredDeleg, GSSCredential delegatedCredential) throws org.apache.wss4j.common.ext.WSSecurityException - Throws:
org.apache.wss4j.common.ext.WSSecurityException
-
decorateSubject
-
getSecretKey
Get the SecretKey associated with the service principal- Returns:
- the SecretKey associated with the service principal
-
isKerberosToken
Return true if the valueType represents a Kerberos Token- Parameters:
valueType- the valueType of the token- Returns:
- true if the valueType represents a Kerberos Token
-
equals
- Overrides:
equalsin classorg.apache.wss4j.common.token.BinarySecurity
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.apache.wss4j.common.token.BinarySecurity
-