Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

403 Error while using AWS CodeCommit after being asked Username & Password (MacOS)

I've been using AWS CodeCommit for a while but currently having the following issue, have no idea what was the reason why it appeared:

  1. After trying to run any git command, I get a dialog box, as I have removed git-credential-osxkeychain from the Keychain Access Control list. Pressing "Deny" (if not doing so, I get 403 immediately).

  2. After pressing "Deny" it gives me

    'NoneType' object has no attribute 'secret_key'
    
  3. Then it asks me for Username and Password

    Username for 'https://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/somerepo': username
    Password for 'https://[email protected]/v1/repos/somerepo':
    
  4. After providing correct credentials here, I get an 403 error

    fatal: unable to access 'https://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/somerepo/': The requested URL returned error: 403
    

I've already tried to reinstall and reset both AWS CLI and Git credentials, have double-checked for possible solutions here and also here, followed all the instructions, but nothing helped.

Please help me with some possible solution. Let me know if any additional information is needed. Thanks!

like image 537
Andrew Avatar asked Nov 16 '22 16:11

Andrew


1 Answers

Refer https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html

Step 1: Initial configuration for CodeCommit

Step 2: Install Git

Step 3: Create Git credentials for HTTPS connections to CodeCommit

Step 4: Connect to the CodeCommit console and clone the repository

Steps 1 and 2 are common, but you may not be aware about step 3.

  1. Go to the AWS console
  2. Go to the IAM user that you are using to access codecommit from the CLI and generate username and password. (The URL looks like https://console.aws.amazon.com/iam/home?region=us-west-2#/users/\<userName>)
  3. Then use this username and password when prompted on the terminal.
like image 123
joe Avatar answered Jan 18 '23 12:01

joe