@Override
public CredentialsDTO getCredentials() {
try {
AssumeRoleProvider provider = new AssumeRoleProvider(OssConfiguration.endpoint, OssConfiguration.accessKey,
OssConfiguration.secretKey, Math.toIntExact(OssConfiguration.expire),
null, OssConfiguration.region, null, null, null, null);
return new CredentialsDTO(provider.fetch(), OssConfiguration.expire);
} catch (NoSuchAlgorithmException e) {
log.debug("Failed to obtain sts.");
e.printStackTrace();
}
return null;
}
public CredentialsDTO getCredentials() {
try {
AssumeRoleProvider provider = new AssumeRoleProvider(OssConfiguration.endpoint, OssConfiguration.accessKey,
OssConfiguration.secretKey, Math.toIntExact(OssConfiguration.expire),
null, OssConfiguration.region, null, null, null, null);
return new CredentialsDTO(provider.fetch(), OssConfiguration.expire);
} catch (NoSuchAlgorithmException e) {
log.debug("Failed to obtain sts.");
e.printStackTrace();
}
return null;
}