# `401 Content access is protected by token` even though I’m using my token

## post by robfletcher on Jun 22, 2024

Rob Fletcher

I have an existing project that publishes to [oss.sonatype.org](http://oss.sonatype.org/). I’ve accessed my token, stored it in my private gradle.properties, and replaced my old username / password configuration with:

```javascript
    maven {
      name = "nexus"
      url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
      credentials {
        username = findProperty("ossrhToken") as String
        password = findProperty("ossrhTokenPassword") as String
      }
    }
```

but I still get `Received status code 401 from server: Content access is protected by token`. I don’t understand what I’m missing.

Do I need to start publishing via `s01.oss.sonatype.org`? I don’t have account credentials there and my understanding was existing projects keep using the original server.

## post by mpiggott on Jun 24, 2024

Matthew Piggott

Hi this is the wrong forum for the discussion, this is is for Nexus Repository as a product.

I believe you want the Central Repository forum.
