Class TokenOperationFactoryImpl
- java.lang.Object
-
- org.forgerock.openam.sts.soap.token.config.TokenOperationFactoryImpl
-
- All Implemented Interfaces:
TokenOperationFactory
public class TokenOperationFactoryImpl extends Object implements TokenOperationFactory
A Factory class which provides all of the lower-level Token{Validator|Provider|Renewer|Canceller} classes which are plugged-into the top-level operation classes corresponding to the fundamental operations defined in WS-Trust.
-
-
Constructor Summary
Constructors Constructor Description TokenOperationFactoryImpl(ThreadLocalAMTokenCache threadLocalAMTokenCache, PrincipalFromSession principalFromSession, TokenServiceConsumer tokenServiceConsumer, String stsInstanceId, String realm, XMLUtilities xmlUtilities, Saml2XmlTokenAuthnContextMapper saml2XmlTokenAuthnContextMapper, com.google.inject.Provider<AMSessionInvalidator> amSessionInvalidatorProvider, SoapSTSAccessTokenProvider soapSTSAccessTokenProvider, AuthenticationHandler<org.apache.wss4j.dom.message.token.UsernameToken> usernameTokenAuthenticationHandler, SoapOpenIdConnectTokenAuthnContextMapper soapOpenIdConnectTokenAuthnContextMapper, SoapOpenIdConnectTokenAuthnMethodsReferencesMapper soapOpenIdConnectTokenAuthnMethodsReferencesMapper, CTSTokenIdGenerator ctsTokenIdGenerator, org.slf4j.Logger logger)This class is a factory for the various operands (token providers, token validators, and the sub-components they require) which are necessary to compose the higher-level ws-trust defined operations (Issue, Validate, Renew, etc).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.cxf.sts.token.validator.TokenValidatorgetSimpleTokenValidator(TokenType validatedTokenType)Returns a TokenValidator which will validate tokens issued by the STS.org.apache.cxf.sts.token.canceller.TokenCancellergetTokenCanceller(TokenType cancelledTokenType)Returns a TokenCanceller instance which will cancel an STS-issued token.org.apache.cxf.sts.token.provider.TokenProvidergetTokenProvider(TokenType issuedTokenType)Called to obtain the set of of TokenProvider instances to satisfy the issue operation.org.apache.cxf.sts.token.validator.TokenValidatorgetTokenValidator(TokenType validatedTokenType, ValidationInvocationContext validationInvocationContext, boolean invalidateAMSession)Returns a TokenValidator instance that can validate the status of the specified TokenType.
-
-
-
Constructor Detail
-
TokenOperationFactoryImpl
@Inject public TokenOperationFactoryImpl(ThreadLocalAMTokenCache threadLocalAMTokenCache, PrincipalFromSession principalFromSession, TokenServiceConsumer tokenServiceConsumer, @Named("sts_instance_id") String stsInstanceId, @Named("am_realm") String realm, XMLUtilities xmlUtilities, Saml2XmlTokenAuthnContextMapper saml2XmlTokenAuthnContextMapper, com.google.inject.Provider<AMSessionInvalidator> amSessionInvalidatorProvider, SoapSTSAccessTokenProvider soapSTSAccessTokenProvider, AuthenticationHandler<org.apache.wss4j.dom.message.token.UsernameToken> usernameTokenAuthenticationHandler, SoapOpenIdConnectTokenAuthnContextMapper soapOpenIdConnectTokenAuthnContextMapper, SoapOpenIdConnectTokenAuthnMethodsReferencesMapper soapOpenIdConnectTokenAuthnMethodsReferencesMapper, CTSTokenIdGenerator ctsTokenIdGenerator, org.slf4j.Logger logger)
This class is a factory for the various operands (token providers, token validators, and the sub-components they require) which are necessary to compose the higher-level ws-trust defined operations (Issue, Validate, Renew, etc).
-
-
Method Detail
-
getTokenValidator
public org.apache.cxf.sts.token.validator.TokenValidator getTokenValidator(TokenType validatedTokenType, ValidationInvocationContext validationInvocationContext, boolean invalidateAMSession) throws STSInitializationException
Returns a TokenValidator instance that can validate the status of the specified TokenType. This method will be consumed to obtain the TokenValidators necessary to enforce SecurityPolicy bindings, and delegated token relationships.- Specified by:
getTokenValidatorin interfaceTokenOperationFactory- Parameters:
validatedTokenType- The type of token to be validatedvalidationInvocationContext- the context of this validation (SecurityPolicy binding enforcement, delegated token context).invalidateAMSession- whether the OpenAM session resulting from successful token validation should be invalidated at the completion of the operation- Returns:
- The TokenValidation implementation which can validate the specified TokenType
- Throws:
STSInitializationException- if the TokenValidator cannot be instantiated
-
getTokenProvider
public org.apache.cxf.sts.token.provider.TokenProvider getTokenProvider(TokenType issuedTokenType) throws STSInitializationException
Description copied from interface:TokenOperationFactoryCalled to obtain the set of of TokenProvider instances to satisfy the issue operation.- Specified by:
getTokenProviderin interfaceTokenOperationFactory- Parameters:
issuedTokenType- the type of token to be created- Returns:
- a TokenProvider implementation which can create the specified token type
- Throws:
STSInitializationException- if an unsupported token type is specified
-
getSimpleTokenValidator
public org.apache.cxf.sts.token.validator.TokenValidator getSimpleTokenValidator(TokenType validatedTokenType) throws STSInitializationException
Description copied from interface:TokenOperationFactoryReturns a TokenValidator which will validate tokens issued by the STS. Note that in the 13 release, this will only involve checking whether the token has been persisted in the CTS. It will not involve the consumption of an authN module. Only TokenValidators will be created for the TokenTypes corresponding to STS-issued tokens - i.e. OIDC and SAML2 tokens.- Specified by:
getSimpleTokenValidatorin interfaceTokenOperationFactory- Parameters:
validatedTokenType- the type of token to be validated.- Returns:
- a TokenValidator implementation which simply consults the TokenService to determine whether the token has been persisted in the CTS.
- Throws:
STSInitializationException- if the TokenValidator cannot be created.
-
getTokenCanceller
public org.apache.cxf.sts.token.canceller.TokenCanceller getTokenCanceller(TokenType cancelledTokenType) throws STSInitializationException
Description copied from interface:TokenOperationFactoryReturns a TokenCanceller instance which will cancel an STS-issued token. This will simply involve invoking the TokenService to remove the token from the CTS. Only TokenCancellers will be created for the TokenTypes corresponding to STS-issued tokens - i.e. OIDC and SAML2 tokens.- Specified by:
getTokenCancellerin interfaceTokenOperationFactory- Parameters:
cancelledTokenType- the type of to-be-cancelled token- Returns:
- A TokenCanceller instance which can handle the cancellation of the specified TokenType
- Throws:
STSInitializationException- if the TokenCanceller cannot be created
-
-