Home > OS >  GitHub - URL could not be accessed: HTTP/1.1 400 Bad Request
GitHub - URL could not be accessed: HTTP/1.1 400 Bad Request

Time:09-28

I am using a private repository in my project ( for example https://github.com/org/repo), and recently I am getting the below error message when I trying to run composer install.

[Composer\Downloader\TransportException]                                                                    
The 'https://api.github.com/repos/org/myrepo' URL could not be accessed: HTTP/1.1 400 Bad Request

CodePudding user response:

You have to update your auth.json file. Please go to Settings > Developer settings > Personal access tokens (Direct URL: https://github.com/settings/tokens) page and generate a new token and copy the token string then enable sso and authorise with your private organisation. Update your auth.json like below format.

{
  "http-basic": {
    "github.com": {
        "username": "<YOUR-USERNAME>",
        "password": "<NEW_TOKEN>"
    }
  }
}
  • Related