createProviderParameters(
tokenType, STSConstants.BEARER_KEY_KEYTYPE, crypto, signatureUsername, callbackHandler
);
if (ttlMs != 0) {
Lifetime lifetime = new Lifetime();
Date creationTime = new Date();
Date expirationTime = new Date();
expirationTime.setTime(creationTime.getTime() + ttlMs);
XmlSchemaDateFormat fmt = new XmlSchemaDateFormat();
lifetime.setCreated(fmt.format(creationTime));
lifetime.setExpires(fmt.format(expirationTime));
providerParameters.getTokenRequirements().setLifetime(lifetime);
}
TokenProviderResponse providerResponse = samlTokenProvider.createToken(providerParameters);