use of org.forgerock.openam.sts.TokenType in project OpenAM by OpenRock.
the class SoapSTSInstanceConfig method toJson.
/**
* @return Provides the json representation of the SoapSTSInstanceConfig instance. The json representation is posted
* to the sts-publish service to programmatically publish an instance of the soap-sts.
*/
public JsonValue toJson() {
JsonValue baseValue = super.toJson();
baseValue.add(DEPLOYMENT_CONFIG, deploymentConfig.toJson());
JsonValue validatedTokenConfiguration = new JsonValue(new ArrayList<>());
List<Object> translationList = validatedTokenConfiguration.asList();
for (TokenValidationConfig tokenValidationConfig : securityPolicyValidatedTokenConfiguration) {
translationList.add(tokenValidationConfig.toJson());
}
baseValue.add(SECURITY_POLICY_VALIDATED_TOKEN_CONFIG, validatedTokenConfiguration);
baseValue.add(SOAP_KEYSTORE_CONFIG, keystoreConfig != null ? keystoreConfig.toJson() : null);
//cannot just add the issueTokenTypes set directly to the baseValue because the enclosing enums will not be quoted
if (issueTokenTypes != null) {
JsonValue issueTokens = new JsonValue(new HashSet<String>());
Collection<String> issueCollection = issueTokens.asCollection(String.class);
for (TokenType tokenType : issueTokenTypes) {
issueCollection.add(tokenType.name());
}
baseValue.add(ISSUE_TOKEN_TYPES, issueTokens);
}
baseValue.add(DELEGATION_RELATIONSHIP_SUPPORTED, String.valueOf(delegationRelationshipsSupported));
baseValue.add(SOAP_DELEGATION_CONFIG, (soapDelegationConfig != null ? soapDelegationConfig.toJson() : null));
return baseValue;
}
use of org.forgerock.openam.sts.TokenType in project OpenAM by OpenRock.
the class TokenCancelOperationProvider method getFunctionalCancelOperation.
private CancelOperation getFunctionalCancelOperation() {
TokenCancelOperation tokenCancelOperation = new TokenCancelOperation();
tokenCancelOperation.setStsProperties(stsPropertiesMBean);
tokenCancelOperation.setTokenStore(tokenStore);
try {
List<TokenCanceller> tokenCancellers = new ArrayList<>();
for (TokenType tokentype : validatedTokens) {
tokenCancellers.add(operationFactory.getTokenCanceller(tokentype));
}
tokenCancelOperation.setTokenCancellers(tokenCancellers);
} catch (STSInitializationException e) {
throw new RuntimeException(e);
}
return new TokenCancelOperationWrapper(tokenCancelOperation, threadLocalAMTokenCache);
}
Aggregations