if (getPublisher()==null || getPassword()==null){
log.warn("No credentials provided for login!");
return null;
}
tokenBirthDate = new Date();
GetAuthToken getAuthToken = new GetAuthToken();
getAuthToken.setUserID(getPublisher());
if (isencrypted) {
if (cryptoProvider == null) {
log.fatal("Credentials are encrypted but no cryptoProvider was defined in the config file!");
} else {
try {
getAuthToken.setCred(CryptorFactory.getCryptor(this.cryptoProvider).decrypt(getPassword()));
} catch (Exception ex) {
log.fatal("Unable to decrypt credentials! sending it as is", ex);
getAuthToken.setCred(getPassword());
}
}
} else {
log.warn("Hey, I couldn't help but notice that your credentials aren't encrypted. Please consider doing so");
getAuthToken.setCred(getPassword());
}
authToken = getUDDINode().getTransport().getUDDISecurityService(endpointURL).getAuthToken(getAuthToken).getAuthInfo();
}
return authToken;
}