use of org.picketlink.config.federation.STSType in project wildfly by wildfly.
the class EntityProviderService method configureTokenProviders.
/**
* <p> Configure the STS Token Providers. </p>
*/
private void configureTokenProviders() {
STSType stsType = getFederationService().getValue().getStsType();
if (stsType != null) {
int tokenTimeout = stsType.getTokenTimeout();
int clockSkew = stsType.getClockSkew();
STSType providerStsType = getPicketLinkType().getStsType();
providerStsType.setTokenTimeout(tokenTimeout);
providerStsType.setClockSkew(clockSkew);
List<TokenProviderType> tokenProviders = providerStsType.getTokenProviders().getTokenProvider();
for (TokenProviderType tokenProviderType : tokenProviders) {
if (tokenProviderType.getTokenType().equals(JBossSAMLURIConstants.ASSERTION_NSURI.get())) {
KeyValueType keyValueTypeTokenTimeout = new KeyValueType();
keyValueTypeTokenTimeout.setKey(GeneralConstants.ASSERTIONS_VALIDITY);
keyValueTypeTokenTimeout.setValue(String.valueOf(tokenTimeout));
KeyValueType keyValueTypeClockSkew = new KeyValueType();
keyValueTypeClockSkew.setKey(GeneralConstants.CLOCK_SKEW);
keyValueTypeClockSkew.setValue(String.valueOf(clockSkew));
tokenProviderType.add(keyValueTypeTokenTimeout);
tokenProviderType.add(keyValueTypeClockSkew);
}
}
}
}
use of org.picketlink.config.federation.STSType in project wildfly by wildfly.
the class SAMLAddHandler method toSAMLConfig.
static STSType toSAMLConfig(OperationContext context, ModelNode fromModel) throws OperationFailedException {
int tokenTimeout = SAMLResourceDefinition.TOKEN_TIMEOUT.resolveModelAttribute(context, fromModel).asInt();
int clockSkew = SAMLResourceDefinition.CLOCK_SKEW.resolveModelAttribute(context, fromModel).asInt();
STSType stsType = new STSType();
stsType.setTokenTimeout(tokenTimeout);
stsType.setClockSkew(clockSkew);
return stsType;
}
use of org.picketlink.config.federation.STSType in project wildfly by wildfly.
the class EntityProviderService method createSTSType.
private STSType createSTSType() {
STSType stsType = null;
InputStream stream = null;
try {
URL url = getClass().getClassLoader().getResource("core-sts.xml");
if (url == null) {
url = Thread.currentThread().getContextClassLoader().getResource("core-sts");
}
if (url != null) {
stream = url.openStream();
stsType = (STSType) new STSConfigParser().parse(stream);
}
} catch (Exception e) {
throw PicketLinkLogger.ROOT_LOGGER.federationCouldNotParseSTSConfig(e);
} finally {
try {
if (stream != null) {
stream.close();
}
} catch (IOException ignored) {
}
}
return stsType;
}
Aggregations