Nono.MA

Solved: Your GitHub OAuth token for github.com contains invalid characters on composer install

APRIL 20, 2021

If you're receiving this error when trying to composer install.

Your GitHub OAuth token for github.com contains invalid characters

Here's what worked for me.

Edit the composer authentication configuration file ~/.composer/auth.json.

nano ~/.composer/auth.json

Then replace the following.

  "github-oauth": {
    "github.com": "ghp_[YOUR-PERSONAL-TOKEN]"
  }

With this (basic auth):

  "http-basic": {
    "github.com": {
      "username": "[YOUR-GITHUB-USERNAME]",
      "password": "ghp_[YOUR-PERSONAL-TOKEN]"
    }
  }

Source

CodePhpComposerLaravelTodo