TokenIssueOperationProvider.java revision 45e9f4e13faca91c1a0f87ef805933e155cf3ae6
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyrighted [year] [name of copyright owner]".
*
* Copyright 2013-2015 ForgeRock AS.
*/
/**
* This class provides instances of the TokenIssueOperation. The configuration information necessary to construct
* an appropriately-configured TokenIssueOperation instance will be injected.
*
* If, for example, we eventually support the set of configuration options for the SAMLTokenProvider, then an additional
* configuration object will be injected into this Provider to support these configurations. And it may well be that
* what is injected is itself a Provider, which has the state necessary to provide the various interface instances necessary
* to configure a SAMLTokenProvider
*
*/
/*
This class exists to wrap top-level STS operations with a finally block to clear the thread-local containing
the OpenAM session cached as part of any token validation operations.
*/
private final TokenIssueOperation issueDelegate;
private final ThreadLocalAMTokenCache threadLocalAMTokenCache;
TokenIssueOperationWrapper(TokenIssueOperation issueDelegate, ThreadLocalAMTokenCache threadLocalAMTokenCache) {
this.issueDelegate = issueDelegate;
}
public RequestSecurityTokenResponseCollectionType issue(RequestSecurityTokenType request, WebServiceContext context) {
try {
} finally {
}
}
public RequestSecurityTokenResponseType issueSingle(RequestSecurityTokenType request, WebServiceContext context) {
try {
} finally {
}
}
}
private final STSPropertiesMBean stsPropertiesMBean;
private final TokenStore tokenStore;
private final TokenOperationFactory operationFactory;
private final ThreadLocalAMTokenCache threadLocalAMTokenCache;
@Named(AMSTSConstants.DELEGATED_TOKEN_VALIDATORS) Set<TokenValidationConfig> delegatedTokenValidationConfig,
this.stsPropertiesMBean = stsPropertiesMBean;
this.tokenStore = tokenStore;
this.issueTokenTypes = issueTokenTypes;
this.operationFactory = operationFactory;
}
public IssueOperation get() {
//TODO: migrate to throwing providers
try {
/*
The STS will not encrypt the issued tokens - the TokenGenerationService already offers functionality to
encrypt issued SAML assertions.
*/
/*
Set the tokenValidators which will be called to validate the tokens presented as ActAs or OnBehalfOf
elements
*/
/*
Set the TokenDelegationHandlers (either empty if this sts instance will not process ActAs or OnBehalfOf elements,
or with the DefaultTokenDelegationHandler, or with user-specified custom handlers.
*/
}
} catch (STSInitializationException e) {
throw new RuntimeException(e);
}
}
}
return tokenValidators;
}
}