Class AnonymousCredentialsProvider

java.lang.Object
software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider
All Implemented Interfaces:
AwsCredentialsProvider, IdentityProvider<AwsCredentialsIdentity>

public final class AnonymousCredentialsProvider extends Object implements AwsCredentialsProvider
Credentials provider that always returns anonymous AwsCredentials. Anonymous AWS credentials result in un-authenticated requests and will fail unless the resource or API's policy has been configured to specifically allow anonymous access.
  • Method Details

    • create

      public static AnonymousCredentialsProvider create()
    • resolveCredentials

      public AwsCredentials resolveCredentials()
      Description copied from interface: AwsCredentialsProvider
      Returns AwsCredentials that can be used to authorize an AWS request. Each implementation of AWSCredentialsProvider can choose its own strategy for loading credentials. For example, an implementation might load credentials from an existing key management system, or load new credentials when credentials are rotated.

      If an error occurs during the loading of credentials or credentials could not be found, a runtime exception will be raised.

      Specified by:
      resolveCredentials in interface AwsCredentialsProvider
      Returns:
      AwsCredentials which the caller can use to authorize an AWS request.
    • toString

      public String toString()
      Overrides:
      toString in class Object