[CodeArtifact] Missing Authentication Token using Curl.

0

Hellooo!!!I have a little problem with CodeArtifact.

I try to upload a test jar in to my repository using curl and the response is: {"message": "Missing Authentication Token"}.

At first, I executed the command to obtain the authorization token:

export CODEARTIFACT_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain XXXXXXX --domain-owner XXXXXXXX --query authorizationToken --output text --profile XXXXXXXX --region XXXXX`

The variable is filled correctly and after, I executed the curl command:

curl --request PUT https://XXXXXXXXXX.d.codeartifact.XXXXXXX.amazonaws.com/XXXXXXXX/test_app.jar --user "aws:$CODEARTIFACT_AUTH_TOKEN" --header "Content-Type: application/octet-stream" --data-binary @test_app.jar

The answer is always the same:

{"message": "Missing Authentication Token"}.

In Curl verbose mode I can see the Authorization basic correctly formed. And I tested the following things:

  • Execute with postman.
  • Put in the CURL directly the token --user "aws:TOKENEXAMPLE......"
  • Increase the token duration time
  • Put a full access policy in the repo configuration.

Maybe I was ignore something?

I'm following the next documents:

https://docs.aws.amazon.com/codeartifact/latest/ug/tokens-authentication.html https://docs.aws.amazon.com/codeartifact/latest/ug/maven-curl.html

Probably I was changed and trying a lot of things and maybe now I can't see the problem.

Thanks for your help!

Monica
asked 2 years ago214 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions