-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue setting credentials provider and region with the new high level configuration #358
Comments
Hey Nathan, Could you share what credential provider you're using? This is generally unexpected behavior; the KMS client is instantiated using the To give more detail:
This shares the
This is functionally equivalent to the first snippet; the top-level
This configures the
This uses the default region with the KMS client, which in your case is not set, hence the |
We are using the following credentials provider: public class S3CredentialsProviderChain implements AwsCredentialsProvider {
private static final Log LOG = LogFactory.getLog(S3CredentialsProviderChain.class);
private boolean tryDefaultChain = true;
@Override
public AwsCredentials resolveCredentials() {
if (this.tryDefaultChain) {
try {
return AwsCredentialsProviderChain.builder().build().resolveCredentials();
} catch (final RuntimeException e) {
// No provider found in the default chain, we won't try it again.
this.tryDefaultChain = false;
LOG.debug("No S3 credentials available; falling back to anonymous access for this session");
}
}
return AnonymousCredentialsProvider.create().resolveCredentials();
}
} I checked in debug mode and an exception is raised when resolving the credentials, thus it returns an |
Hey @NathanEckert, When you set the |
Problem:
Latest version 3.2.1 of the encryption client.
With the new high level configuration (see https://github.com/aws/amazon-s3-encryption-client-java/blob/main/src/examples/java/software/amazon/encryption/s3/examples/ClientConfigurationExample.java),
I was expecting to be able to create my client like this:
However, when reading a KMS enrcypted file, this does not work
software.amazon.encryption.s3.S3EncryptionClientException: Missing Authentication Token (Service: Kms, Status Code: 400, Request ID: ***************)
I tried the following variations:
This raised the same exception
Finally, the one I got working is the one were I remove the high level provider:
Also, I was surprised to see the following failing:
With this time a different error:
software.amazon.awssdk.core.exception.SdkClientException: Unable to load region from any of the providers in the chain software.amazon.awssdk.regions.providers.DefaultAwsRegionProviderChain
Shouldn't all of those work ?
The text was updated successfully, but these errors were encountered: