When composer connects to GitHub I receive a warning about a deprecation authentication method. What authentication configuration should I use?

Of these two configurations, the first is the correct one.

The "string" should be your Personal Access Token (PAT), configured with the appropriate access scopes on GitHub.

To configure the scopes for your token you need to visit your GitHub Developer Settings -> Personal Access Tokens.

The second format attempts to authenticate sending your username and password instead of a generated token. That's a bad security practice, and should not be done.

But the main reason you are getting the first warning is because you are running an old composer version.

You need to update to the 1.9.3 version, where this was fixed. On previous versions you may get the deprecation warning nonetheless because of how composer connects to GitHub.


Update composer and the error will disappear

php composer.phar self-update

or

composer self-update