Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#4314·opentofu

tofu does not supply available credentials (for example from credentials.tfrc.json) to the http request attempting to download a provider package from a registry.

Author: shepsesCreated Jun 25, 2026Updated Sep 17, 2026
Labelsenhancementaccepted

Community note

[!TIP] Hi there, OpenTofu community! The OpenTofu team prioritizes issues based on upvotes. Please make sure to upvote this issue and describe how it affects you in detail in the comments to show your support.

OpenTofu Version

bash
main branch
1.12.2

OpenTofu Configuration Files

.tofurc

hcl
provider_installation {
  network_mirror {
    url = "https://protected.custom.server/tofu/providers"
    include = ["registry.opentofu.org/*/*"]
  }
}

credentials.tfrc.json

json
{
  "credentials": {
    "token": "SECRET"
  }
}

Debug Output

unsuccessful request to ... 401

Expected Behavior

The request that's supposed to download the provider using supplied credentials succeeds.

Actual Behavior

Requests to repository json files for providers such as index.json or $numversion.json (see https://opentofu.org/docs/internals/provider-registry-protocol/) succeed usign supplied credentials but the final request fails.

Steps to Reproduce

tofu init with a protected private registry and config files as described.

Additional Context

Code in https://github.com/veith4f/opentofu/tree/feature/include_credentials_in_getprovider_http_request fixes the issue. I am currently using it. See also. https://github.com/veith4f/opentofu/releases

References

No response

Source: opentofu/opentofu

View original on GitHubView discussion on GitHub