Home > Software engineering >  Authorization Header not being sent to Maven Repository
Authorization Header not being sent to Maven Repository

Time:09-17

I am currently building my own Maven Repository. I am trying to add support for private repositories. However, I configured my repo here

pom.xml

        <repository>
            <id>kingtux-dev</id>
            <name>My Developer Repo</name>
            <url>http://127.0.0.1:6742/storages/public/maven</url>
        </repository>

settings.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
     <servers>
      <server>
         <id>kingtux-dev</id>
         <username>user</username>
         <password>password</password>
      </server>
   </servers>
</settings>

My software does not detect any sort of Authorization header though.

The only headers it finds is

cache-control: no-cache
accept-encoding: gzip,deflate
cache-store: no-store
user-agent: Apache-Maven/3.6.3 (Java 11.0.11; Linux 5.11.0-7633-generic)
host: 127.0.0.1:6742
connection: Keep-Alive
pragma: no-cache

CodePudding user response:

The issue was as kmarbaise suggested.

Return a https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/WWW-Authenticate on a failure to authenticate and Maven will return will the authorization header.

  • Related