0
votes

I am trying to clone a aws codecommit repository but I'm getting Unable to access: 403 error.

I am using credential helper for connecting to codecommit.

This is my .gitconfig file.

[credential]
 helper = !aws --profile 
 codecommitprofile codecommit 
 credential-helper $@
 UseHttpPath = true

I have configured the aws profile using access key Id and secret access key. Also I cleared all the git credentials before accessing the repository, but still getting the same error everytime.

Any help will be appreciated.

1
AWS has dedicated document for this error, please check it: docs.aws.amazon.com/codecommit/latest/userguide/… - shariqmaws

1 Answers

0
votes

Mac OS user here. Also stumbled upon this 403 issue and spent lots of time looking through AWS docs. Finally, this little thing saved my day (or should I say night):

Open Keychain Access app and look for an entry with git-codecommit-...-amazonaws.com and cached Internet password.

See the picture

You can safely delete this row, as this password expires anyway after 15 minutes. And voila! Pesky 403 is gone and commit is in the cloud. Hope this helps anyone who is looking for a fast straight-forward solution...

P.S. Unfortunately, this is just a quick fix, as on the next attempt to access your repository you will still face the same issue and will need to clear the cached password again.