verdaccio: Cannot authenticate to JFrog Artifactory as uplink - "Authorization" header not always sent
My reason:
Cannot authenticate to Artifactory uplink. I can connect directly to Artifactory by setting its information in npmrc. When I switch to verdaccio with Artifactory as uplink, authentication fails.
Steps to reproduce:
Configure Artifactory as an uplink. Try to install a module with NPM pointing to verdaccio.
App Version:
verdaccio/2.7.4
Config file:
Relevant portion:
uplinks:
artifactory:
url: https://artifactory.mydomain.com/artifactory/api/npm/npm-main/
headers:
# I tried several variations of "Accept" with no difference
# Accept: application/json;
# Accept: application/json; q=0.8, */*
authorization: Basic MyBase64Credentials==
packages:
'@*/*':
access: $all
publish: $authenticated
proxy: artifactory
'**':
access: $all
proxy: artifactory
Additional information:
$ set DEBUG=express:* verdaccioenable extreme verdaccio debug mode- This did not do anything for me
- Verdaccio terminal output
warn --- http address - http://localhost:4873/ - verdaccio/2.7.4
info <-- 127.0.0.1 requested 'GET /lodash'
info --> making request: 'GET https://artifactory.mydomain.com/artifactory/api/npm/npm-main/lodash'
http --> 401, req: 'GET https://artifactory.mydomain.com/artifactory/api/npm/npm-main/lodash' (streaming)
http --> 401, req: 'GET https://artifactory.mydomain.com/artifactory/api/npm/npm-main/lodash', bytes: 0/91
debug-=- updating package info
http <-- 200, user: cjohnston(127.0.0.1), req: 'GET /lodash', bytes: 0/13669
info <-- 127.0.0.1 requested 'GET /lodash/-/lodash-4.17.5.tgz'
info --> making request: 'GET https://artifactory.mydomain.com:443/artifactory/api/npm/npm-main/lodash/-/lodash-4.17.5.tgz'
http <-- 500, user: cjohnston(127.0.0.1), req: 'GET /lodash/-/lodash-4.17.5.tgz', error: bad uplink status code: 401
info <-- 127.0.0.1 requested 'GET /lodash/-/lodash-4.17.5.tgz'
info --> making request: 'GET https://artifactory.mydomain.com:443/artifactory/api/npm/npm-main/lodash/-/lodash-4.17.5.tgz'
http <-- 500, user: cjohnston(127.0.0.1), req: 'GET /lodash/-/lodash-4.17.5.tgz', error: bad uplink status code: 401
- Windows, OS X/macOS, or Linux?:
- MacOS
- Container:
- I use local environment
Additional verbose log:
I don’t know how to get a more verbose log of the uplink connection.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (10 by maintainers)
Commits related to this issue
- test: add unit test for isUplinkValid #571 — committed to verdaccio/verdaccio by juanpicado 6 years ago
- fix: allow uplink comparison for https protocol fix #571 — committed to verdaccio/verdaccio by juanpicado 6 years ago
- test: add unit test for isUplinkValid #571 — committed to verdaccio/verdaccio by juanpicado 6 years ago
- fix: allow uplink comparison for https protocol fix #571 — committed to verdaccio/verdaccio by juanpicado 6 years ago
- fix: allow uplink comparison for https protocol fix #571 — committed to verdaccio/verdaccio by juanpicado 6 years ago
- Merge pull request #589 from verdaccio/fix-571 test: add unit test for isUplinkValid #571 — committed to verdaccio/verdaccio by juanpicado 6 years ago
It will take a while since I need to write some unit test to ensure this will never happen again.
I am really confused. With no change to version or configuration everything seems to be working now.
I’ve only tested from home over VPN - I’d like to verify that things work when I’m connected to my company’s network. I’ll do that on Tuesday and report back on if this is still an issue or not.