Skip to main content

New composer-authstore-plugin release

· One min read
Stephan Hochdörfer
Head of IT Business Operations

Thanks to a Pull Request by Jérôme Vieilledent I was able to create a new version (0.2) of the authstore plugin for Composer. The latest version of the plugin allows you to store the auth credentials inside your project folder. Simply add a file named auth.json to your project folder next to your composer.json file which looks like this:

{
"config": {
"basic-auth": {
"satis.loc": {
"username": "my_username",
"password": "my_password"
}
}
}
}

The plugin will now pick up the auth credentials from this file (in addition to the ones defined globally in COMPOSER_HOME/auth.json). The local auth.json configuration always has precedence if a host is defined both locally and globally.

Be aware that it is recommended to either put your credentials in the global auth.json file or add the local auth.json to .gitignore. If you do share your local auth.json with the world anyone could see and use your credentials. This is probably not what you really want!