ARTIFACTORY: How to fix error: authenticated registries require a credential-provider to be configured

Products
Frog_Artifactory
Content Type
User_Guide
AuthorFullName__c
Jian Sun
articleNumber
000006664
FirstPublishedDate
2025-10-20T12:11:03Z
lastModifiedDate
2025-10-20

ARTIFACTORY: How to fix error: authenticated registries require a credential-provider to be configured

Description 

When configuring Cargo using the "Set Me Up" instructions and subsequently running the cargo publish or cargo install command, users may encounter an error.
$ cargo publish --allow-dirty --registry artifactory
    Updating `artifactory` index
error: authenticated registries require a credential-provider to be configured


Root Cause 

The error occurs because the credential-provider is missing in the ~/.cargo/config.toml file.


Resolution 


Set the credential-provider = "cargo:token" under the “token =” line in the ~/.cargo/config.toml file, such as:
[registry]
default = "artifactory"

[registries.artifactory]
index = "sparse+https://xx/artifactory/api/cargo/cargo-local/index/"
token = "Bearer xxxx"
credential-provider = "cargo:token"
Then run the cargo publish/install command again, it will succeed now.