Nexus 2 (NPM)

Configuration & Troubleshooting

Overview

Nexus 2 lacks Bearer token support and does not provide a way to easily provide basic authentication credentials. Since Nexus doesn’t provide credentials out of the box, and many NES packages have public trials that don’t require authentication, consumers will only see listings for those versions.

To overcome this, the NES Registry will inspect User Agent headings and immediately reject any requests lacking an Authentication header if the string nes-require-auth=basic is found. Nexus can be configured to provide this via the HTTP Request Settings (optional) > User Agent field.

Authentication Required Configuration

"Step 1a"

"Step 2a"

Troubleshooting

Determining if Nexus 2 is correctly sending the right information can be tricky. Validation steps should be:

Step 1: Validate network access

  1. Setup the proxy registry with no credentials and no User Agent
  2. Navigate to nexus/content/repositories/<your_repo>/@neverendingsupport/vue2 and verify that you see the trial versions of vue (publicly available)
  3. Navigate to nexus/content/repositories/<your_repo>/@neverendingsupport/vue2 and note what versions are available, if any.

Step 2: Validate requiring auth works correctly

  1. Add User Agent, but do not provide authentication (See configurations below)
  2. Navigate to nexus/content/repositories/<your_repo>/@neverendingsupport/vue2 and verify that the request failed.

Step 3: Verify auth is working

  1. Add User Agent and correct credentials
  2. Navigate to a package you have access to
  3. Validate non-trial versions are present, where they were not
  4. Follow link to an asset (search for .tgz for easy access) and verify download
  5. Observe the listing in nexus/content/repositories/<your_repo>/ should now have packages.
  6. Configure projects to download from your nexus proxy and pull as expected.

Validate requiring authentication without providing credentials fails

"Step 1b"

"Step 2b"

Validate providing incorrect credentials shows public packages

"Step 1c"

Viewed in localhost

"Step 2c"