atlassian / terraform-provider-artifactory

Terraform provider to manage Artifactory
Apache License 2.0
89 stars 42 forks source link

"Only one auth mechanism allowed" error when using Basic auth #87

Open valorl opened 4 years ago

valorl commented 4 years ago

Community Note

Terraform Version

Terraform 0.12.13 Artifactory Provider v2.0.0

Affected Resource(s)

Expected Behavior

When using the artifactory provider with ARTIFACTORY_USERNAME and ARTIFACTORY_PASSWORD set (Basic auth). The artifactory_file data source should be handled without errors provided the credentials are correct.

Actual Behavior

The tf plan fails with the following message:

<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>InvalidArgument</Code>
  <Message>Only one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified</Message>
  <ArgumentName>Authorization</ArgumentName>
  <ArgumentValue>Basic ********************</ArgumentValue>
  <RequestId>********************</RequestId>
  <HostId>********************</HostId>
</Error>

Steps to Reproduce

  1. Add the provider provider "artifactory" {}
  2. Set valid env vars for ARTIFACTORY_URL (or optionally provide URL in provider block), ARTIFACTORY_USERNAME and ARTIFACTORY_PASSWORD
  3. Add some data "artifactory_file" "test" { ... } data source block. (Only tested this with a valid artifactory repository and file. Not sure if this can be reproduced with dummy values too.)
  4. Execute tf plan

Important Factoids

References

peters95 commented 3 years ago

Migrated -> https://github.com/jfrog/terraform-provider-artifactory/issues/22