Authentication

Jeff Caddel edited this page Jul 10, 2014 · 47 revisions
Clone this wiki locally

Beginning with version 1.2.1, the wagon supports 4 methods for authenticating with Amazon S3.

1 - System Properties: aws.accessKeyId + aws.secretKey

2 - Environment Variables: AWS_ACCESS_KEY_ID + AWS_SECRET_KEY

3 - Entries in ~/.m2/settings.xml

    <servers>
     <server>
      <id>[repository id]</id>
      <username>[AWS Access Key ID]</username>
      <password>[AWS Secret Access Key]</password>
     </server>
    </servers>

4 - IAM Role - This is ultra convenient when the wagon is running on an Amazon EC2 instance. By associating an IAM role with your EC2 instance, Amazon's java SDK is able to automatically authenticate with S3 on its own. There are no credentials to keep track of or manage!

The priority used when searching for credentials is the same as the order listed on this page. For example, if a set of credentials is found in the system properties, the next three areas are never checked. If no credentials can be found, an exception is thrown.