Apache CXF API

org.apache.cxf.sts.operation
Class AbstractOperation

java.lang.Object
  extended by org.apache.cxf.sts.operation.AbstractOperation
Direct Known Subclasses:
TokenCancelOperation, TokenIssueOperation, TokenRenewOperation, TokenRequestCollectionOperation, TokenValidateOperation

public abstract class AbstractOperation
extends Object

This abstract class contains some common functionality for different operations.


Field Summary
protected  ClaimsManager claimsManager
           
protected  List<TokenDelegationHandler> delegationHandlers
           
protected  boolean encryptIssuedToken
           
protected  STSEventListener eventPublisher
           
protected  boolean returnReferences
           
protected  List<ServiceMBean> services
           
protected  STSPropertiesMBean stsProperties
           
static QName TOKEN_TYPE
           
protected  List<TokenProvider> tokenProviders
           
protected  TokenStore tokenStore
           
protected  List<TokenValidator> tokenValidators
           
 
Constructor Summary
AbstractOperation()
           
 
Method Summary
protected  void checkClaimsSupport(ClaimCollection requestedClaims)
           
protected static LifetimeType createLifetime(Date tokenCreated, Date tokenExpires)
          Create a LifetimeType object given a created + expires Dates
protected static RequestedReferenceType createRequestedReference(String tokenId, String tokenType, boolean attached)
          Create a RequestedReferenceType object using a token id and tokenType
protected static RequestedReferenceType createRequestedReference(TokenReference tokenReference, boolean attached)
          Create a RequestedReferenceType object using a TokenReference object
protected  TokenProviderParameters createTokenProviderParameters(RequestParser requestParser, WebServiceContext context)
          Create a TokenProviderParameters object given a RequestParser and WebServiceContext object
protected  Element encryptSecret(byte[] secret, EncryptionProperties encryptionProperties, KeyRequirements keyRequirements)
          Encrypt a secret using the given arguments producing a DOM EncryptedKey element
protected  Element encryptToken(Element element, String id, EncryptionProperties encryptionProperties, KeyRequirements keyRequirements, WebServiceContext context)
          Encrypt a Token element using the given arguments.
protected  String extractAddressFromAppliesTo(Element appliesTo)
          Extract an address from an AppliesTo DOM element
protected static org.apache.xml.security.stax.securityToken.SecurityToken findInboundSecurityToken(org.apache.xml.security.stax.securityEvent.SecurityEventConstants.Event event, MessageContext messageContext)
           
 ClaimsManager getClaimsManager()
           
 List<TokenDelegationHandler> getDelegationHandlers()
           
 List<TokenProvider> getTokenProviders()
           
 TokenStore getTokenStore()
           
 List<TokenValidator> getTokenValidators()
           
 boolean isReturnReferences()
           
protected  RequestParser parseRequest(RequestSecurityTokenType request, WebServiceContext context)
          Check the arguments from the STSProvider and parse the request.
protected  void performDelegationHandling(RequestParser requestParser, WebServiceContext context, ReceivedToken token, Principal tokenPrincipal, Set<Principal> tokenRoles)
           
protected  void processValidToken(TokenProviderParameters providerParameters, ReceivedToken validatedToken, TokenValidatorResponse tokenResponse)
           
protected  void publishEvent(AbstractSTSEvent event)
           
 void setClaimsManager(ClaimsManager claimsManager)
           
 void setDelegationHandlers(List<TokenDelegationHandler> delegationHandlers)
           
 void setEncryptIssuedToken(boolean encryptIssuedToken)
           
 void setEventListener(STSEventListener eventListener)
           
 void setReturnReferences(boolean returnReferences)
           
 void setServices(List<ServiceMBean> services)
           
 void setStsProperties(STSPropertiesMBean stsProperties)
           
 void setTokenProviders(List<TokenProvider> tokenProviders)
           
 void setTokenStore(TokenStore tokenStore)
           
 void setTokenValidators(List<TokenValidator> tokenValidators)
           
protected  TokenValidatorResponse validateReceivedToken(WebServiceContext context, String realm, TokenRequirements tokenRequirements, ReceivedToken token)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOKEN_TYPE

public static final QName TOKEN_TYPE

stsProperties

protected STSPropertiesMBean stsProperties

encryptIssuedToken

protected boolean encryptIssuedToken

services

protected List<ServiceMBean> services

tokenProviders

protected List<TokenProvider> tokenProviders

tokenValidators

protected List<TokenValidator> tokenValidators

returnReferences

protected boolean returnReferences

tokenStore

protected TokenStore tokenStore

claimsManager

protected ClaimsManager claimsManager

eventPublisher

protected STSEventListener eventPublisher

delegationHandlers

protected List<TokenDelegationHandler> delegationHandlers
Constructor Detail

AbstractOperation

public AbstractOperation()
Method Detail

isReturnReferences

public boolean isReturnReferences()

setReturnReferences

public void setReturnReferences(boolean returnReferences)

getTokenStore

public TokenStore getTokenStore()

setTokenStore

public void setTokenStore(TokenStore tokenStore)

setStsProperties

public void setStsProperties(STSPropertiesMBean stsProperties)

setEncryptIssuedToken

public void setEncryptIssuedToken(boolean encryptIssuedToken)

setServices

public void setServices(List<ServiceMBean> services)

setTokenProviders

public void setTokenProviders(List<TokenProvider> tokenProviders)

getDelegationHandlers

public List<TokenDelegationHandler> getDelegationHandlers()

setDelegationHandlers

public void setDelegationHandlers(List<TokenDelegationHandler> delegationHandlers)

getTokenProviders

public List<TokenProvider> getTokenProviders()

setTokenValidators

public void setTokenValidators(List<TokenValidator> tokenValidators)

getTokenValidators

public List<TokenValidator> getTokenValidators()

getClaimsManager

public ClaimsManager getClaimsManager()

setClaimsManager

public void setClaimsManager(ClaimsManager claimsManager)

parseRequest

protected RequestParser parseRequest(RequestSecurityTokenType request,
                                     WebServiceContext context)
Check the arguments from the STSProvider and parse the request.


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

protected static LifetimeType createLifetime(Date tokenCreated,
                                             Date tokenExpires)
Create a LifetimeType object given a created + expires Dates


encryptToken

protected Element encryptToken(Element element,
                               String id,
                               EncryptionProperties encryptionProperties,
                               KeyRequirements keyRequirements,
                               WebServiceContext context)
                        throws org.apache.wss4j.common.ext.WSSecurityException
Encrypt a Token element using the given arguments.

Throws:
org.apache.wss4j.common.ext.WSSecurityException

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

protected String extractAddressFromAppliesTo(Element appliesTo)
Extract an address from an AppliesTo DOM element


createTokenProviderParameters

protected TokenProviderParameters createTokenProviderParameters(RequestParser requestParser,
                                                                WebServiceContext context)
Create a TokenProviderParameters object given a RequestParser and WebServiceContext object


validateReceivedToken

protected TokenValidatorResponse validateReceivedToken(WebServiceContext context,
                                                       String realm,
                                                       TokenRequirements tokenRequirements,
                                                       ReceivedToken token)

performDelegationHandling

protected void performDelegationHandling(RequestParser requestParser,
                                         WebServiceContext context,
                                         ReceivedToken token,
                                         Principal tokenPrincipal,
                                         Set<Principal> tokenRoles)

checkClaimsSupport

protected void checkClaimsSupport(ClaimCollection requestedClaims)

processValidToken

protected void processValidToken(TokenProviderParameters providerParameters,
                                 ReceivedToken validatedToken,
                                 TokenValidatorResponse tokenResponse)

setEventListener

public void setEventListener(STSEventListener eventListener)

publishEvent

protected void publishEvent(AbstractSTSEvent event)

findInboundSecurityToken

protected static org.apache.xml.security.stax.securityToken.SecurityToken findInboundSecurityToken(org.apache.xml.security.stax.securityEvent.SecurityEventConstants.Event event,
                                                                                                   MessageContext messageContext)
                                                                                            throws org.apache.xml.security.exceptions.XMLSecurityException
Throws:
org.apache.xml.security.exceptions.XMLSecurityException

Apache CXF API

Apache CXF