Search code examples
dependenciessbtartifactoryunauthorized

Why does Artifactory return '401 unauthorized' for artifact with anonymous read permission?


I managed to successfully publish an sbt repo to Artifactory.

I also managed to successfully use this repo from a test project, where build.sbt is

credentials += Credentials(Path.userHome / ".sbt" / ".credentials")

resolvers += "Artifactory" at "https://hyperbot.jfrog.io/artifactory/hyperbot/"

libraryDependencies += "com.example" % "scalautils_2.13" % "0.1.0-SNAPSHOT"

However if I don't submit my credentials in build.sbt, then build returns 401 unathorized error for resolving "com.example" % "scalautils_2.13" % "0.1.0-SNAPSHOT" dependency.

If I try to open the artifact url

https://hyperbot.jfrog.io/artifactory/hyperbot/com/example/scalautils_2.13/0.1.0-SNAPSHOT/scalautils_2.13-0.1.0-SNAPSHOT.pom

in the browser, it asks for credentials (if I provide the credentials, the artifact is served).

Permission of anonymous user is set to Read in this repository.

What can I do to allow anonymous access for this artifact?


Solution

  • It is not enough the set access rights for the anonymous user, you also need to enable anonymous access at large:

    enter image description here

    Problem solved.