When you install a Composer package that requires authentication, the license credentials (username and license key) are stored permanently on your system. While this is convenient, it can make upgrading your license a bit tricky later on — since Composer won’t prompt you again for new credentials.
But don’t worry — in this guide, we’ll walk you through how to update or replace the stored license for a Composer package.
Composer saves license credentials in a global configuration file called auth.json
. This file is stored in a system-specific location depending on your OS, which can be a bit tricky to find manually.
Fortunately, you don’t need to dig into that file. Composer provides a simple command to update the stored credentials globally.
To replace the existing license with a new one, run the following command:
composer config -g http-basic.package-name.hexters.com username license_key
Example:
composer config -g http-basic.package-name.hexters.com 44786536 69d5b9d7-2323-4496-a799-8dc3bc550a88
This command sets the new credentials globally, so you don’t need to run it inside your project folder. Composer will now use the updated license key for any future install or update requests related to that package.
This method is useful when: