Package org.apache.cxf.sts.operation
Class AbstractOperation
java.lang.Object
org.apache.cxf.sts.operation.AbstractOperation
- Direct Known Subclasses:
TokenCancelOperation,TokenIssueOperation,TokenRenewOperation,TokenRequestCollectionOperation,TokenValidateOperation
This abstract class contains some common functionality for different operations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected ClaimsManagerprotected List<TokenDelegationHandler>protected booleanprotected STSEventListenerprotected booleanprotected booleanprotected List<ServiceMBean>protected STSPropertiesMBeanstatic final QNameprotected List<TokenProvider>protected TokenStoreprotected List<TokenValidator>protected TokenWrapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcleanRequest(RequestRequirements requestRequirements) protected static LifetimeTypecreateLifetime(Instant tokenCreated, Instant tokenExpires) Create a LifetimeType object given a created + expires Datesprotected static RequestedReferenceTypecreateRequestedReference(String tokenId, String tokenType, boolean attached) Create a RequestedReferenceType object using a token id and tokenTypeprotected static RequestedReferenceTypecreateRequestedReference(TokenReference tokenReference, boolean attached) Create a RequestedReferenceType object using a TokenReference objectprotected TokenProviderParameterscreateTokenProviderParameters(RequestRequirements requestRequirements, Principal principal, Map<String, Object> messageContext) Create a TokenProviderParameters objectprotected ElementencryptSecret(byte[] secret, EncryptionProperties encryptionProperties, KeyRequirements keyRequirements) Encrypt a secret using the given arguments producing a DOM EncryptedKey elementprotected StringextractAddressFromAppliesTo(Element appliesTo) Extract an address from an AppliesTo DOM elementprotected static org.apache.xml.security.stax.securityToken.SecurityTokenfindInboundSecurityToken(org.apache.xml.security.stax.securityEvent.SecurityEventConstants.Event event, Map<String, Object> messageContext) booleanbooleanbooleanprotected RequestRequirementsparseRequest(RequestSecurityTokenType request, Map<String, Object> messageContext) Check the arguments from the STSProvider and parse the request.protected voidperformDelegationHandling(RequestRequirements requestRequirements, Principal principal, Map<String, Object> messageContext, ReceivedToken token, Principal tokenPrincipal, Set<Principal> tokenRoles) protected voidprocessValidToken(TokenProviderParameters providerParameters, ReceivedToken validatedToken, TokenValidatorResponse tokenResponse) protected voidpublishEvent(AbstractSTSEvent event) voidsetAllowCustomContent(boolean allowCustomContent) voidsetClaimsManager(ClaimsManager claimsManager) voidsetDelegationHandlers(List<TokenDelegationHandler> delegationHandlers) voidsetEncryptIssuedToken(boolean encryptIssuedToken) voidsetEventListener(STSEventListener eventListener) voidsetIncludeLifetimeElement(boolean value) voidsetReturnReferences(boolean returnReferences) voidsetServices(List<ServiceMBean> services) voidsetStsProperties(STSPropertiesMBean stsProperties) voidsetTokenProviders(List<TokenProvider> tokenProviders) voidsetTokenStore(TokenStore tokenStore) voidsetTokenValidators(List<TokenValidator> tokenValidators) voidsetTokenWrapper(TokenWrapper tokenWrapper) protected TokenValidatorResponsevalidateReceivedToken(Principal principal, Map<String, Object> messageContext, String realm, TokenRequirements tokenRequirements, ReceivedToken token)
-
Field Details
-
TOKEN_TYPE
-
stsProperties
-
encryptIssuedToken
protected boolean encryptIssuedToken -
services
-
tokenProviders
-
tokenValidators
-
returnReferences
protected boolean returnReferences -
tokenStore
-
claimsManager
-
eventPublisher
-
delegationHandlers
-
tokenWrapper
-
allowCustomContent
protected boolean allowCustomContent -
includeLifetimeElement
protected boolean includeLifetimeElement
-
-
Constructor Details
-
AbstractOperation
public AbstractOperation()
-
-
Method Details
-
isAllowCustomContent
public boolean isAllowCustomContent() -
setAllowCustomContent
public void setAllowCustomContent(boolean allowCustomContent) -
getTokenWrapper
-
setTokenWrapper
-
isReturnReferences
public boolean isReturnReferences() -
setReturnReferences
public void setReturnReferences(boolean returnReferences) -
getTokenStore
-
setTokenStore
-
setStsProperties
-
setEncryptIssuedToken
public void setEncryptIssuedToken(boolean encryptIssuedToken) -
setServices
-
setTokenProviders
-
getDelegationHandlers
-
setDelegationHandlers
-
getTokenProviders
-
setTokenValidators
-
getTokenValidators
-
getClaimsManager
-
setClaimsManager
-
setIncludeLifetimeElement
public void setIncludeLifetimeElement(boolean value) -
isIncludeLifetimeElement
public boolean isIncludeLifetimeElement() -
parseRequest
protected RequestRequirements parseRequest(RequestSecurityTokenType request, Map<String, Object> messageContext) Check the arguments from the STSProvider and parse the request. -
cleanRequest
-
createRequestedReference
protected static RequestedReferenceType createRequestedReference(TokenReference tokenReference, boolean attached) Create a RequestedReferenceType object using a TokenReference object -
createRequestedReference
protected static RequestedReferenceType createRequestedReference(String tokenId, String tokenType, boolean attached) Create a RequestedReferenceType object using a token id and tokenType -
createLifetime
Create a LifetimeType object given a created + expires Dates -
encryptSecret
protected Element encryptSecret(byte[] secret, EncryptionProperties encryptionProperties, KeyRequirements keyRequirements) throws org.apache.wss4j.common.ext.WSSecurityException Encrypt a secret using the given arguments producing a DOM EncryptedKey element- Throws:
org.apache.wss4j.common.ext.WSSecurityException
-
extractAddressFromAppliesTo
Extract an address from an AppliesTo DOM element -
createTokenProviderParameters
protected TokenProviderParameters createTokenProviderParameters(RequestRequirements requestRequirements, Principal principal, Map<String, Object> messageContext) Create a TokenProviderParameters object -
validateReceivedToken
protected TokenValidatorResponse validateReceivedToken(Principal principal, Map<String, Object> messageContext, String realm, TokenRequirements tokenRequirements, ReceivedToken token) -
performDelegationHandling
protected void performDelegationHandling(RequestRequirements requestRequirements, Principal principal, Map<String, Object> messageContext, ReceivedToken token, Principal tokenPrincipal, Set<Principal> tokenRoles) -
processValidToken
protected void processValidToken(TokenProviderParameters providerParameters, ReceivedToken validatedToken, TokenValidatorResponse tokenResponse) -
setEventListener
-
publishEvent
-
findInboundSecurityToken
protected static org.apache.xml.security.stax.securityToken.SecurityToken findInboundSecurityToken(org.apache.xml.security.stax.securityEvent.SecurityEventConstants.Event event, Map<String, Object> messageContext) throws org.apache.xml.security.exceptions.XMLSecurityException- Throws:
org.apache.xml.security.exceptions.XMLSecurityException
-