Skip to content

Unable to install package with basic authentication #2560

@pintify

Description

@pintify

Describe the bug
The download/install via URL is not capable to process URLs with user/pass authentication included.

To Reproduce

  1. Go to Packages tab -> Install/Upgrade package -> URL
  2. Insert a url with format https://username:[email protected]/packages/package1.dp
  3. Install fails with
2019-10-23T14:22:30,038 [DeploymentAgent] ERROR o.e.k.d.a.i.DeploymentAgent - Exception installing package at URL https://username:[email protected]/packages/package1.dp
java.io.IOException: Server returned HTTP response code: 401 for URL: https://username:[email protected]/packages/package1.dp
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900) ~[?:1.8.0_232]
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498) ~[?:1.8.0_232]
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268) ~[?:1.8.0_232]
	at org.eclipse.kura.deployment.agent.impl.DeploymentAgent.getFileFromRemote(DeploymentAgent.java:492) ~[?:?]
	at org.eclipse.kura.deployment.agent.impl.DeploymentAgent.installDeploymentPackageInternal(DeploymentAgent.java:441) ~[?:?]
	at org.eclipse.kura.deployment.agent.impl.DeploymentAgent.installer(DeploymentAgent.java:309) ~[?:?]
	at org.eclipse.kura.deployment.agent.impl.DeploymentAgent.lambda$0(DeploymentAgent.java:173) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_232]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]

The URL works perfectly when used from curl.

Expected behavior
Authentication is processed and package installed.

Target Environment:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions