question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTTP 400 when using jwt

See original GitHub issue

Describe the bug

If i enable jwt (which is enabled for web ui by default) i always get a 400 bad request reponse whenever i try to use the jwt auth token. There is no log entry for the request.

To Reproduce

  1. configure bitbucket-server as auth
  2. push a package
  3. login to webui
  4. view browser console for 400 error

Expected behavior jwt auth should just work with any auth module

Screenshots If applicable, add screenshots to help explain your problem.

Docker || Kubernetes (please complete the following information):

  • Docker verdaccio tag: [e.g. verdaccio:4.x]
  • Docker commands [e.g. docker pull …]
  • Docker Version [e.g. v18.05.0-ce-rc1] 18.09.9 / Rancher v1.6.28

https://github.com/VisualOn/docker-images/tree/master/docker/verdaccio

Configuration File (cat ~/.config/verdaccio/config.yaml)

storage: /verdaccio/storage/data
plugins: /verdaccio/plugins

web:
  title: Verdaccio

auth:
  bitbucket-server:
    url: "http://server.bitbucket:7990"
    allow: "stash-users" # optional; default = ""

# a list of other known repositories we can talk to
uplinks:
  npmjs:
    url: https://registry.npmjs.org/
  pkg:
    url: https://server.proget/npm/vo-npm/

packages:
  '@vo/*':
    # scoped packages
    access: $authenticated
    publish: $authenticated
    unpublish: $authenticated
    proxy: pkg
    storage: vo
    
  '@*/*':
    # scoped packages
    access: $all
    publish: $authenticated
    unpublish: $authenticated
    proxy: npmjs
    storage: npmjs

  '**':
    access: $all
    publish: $authenticated
    unpublish: $authenticated
    proxy: npmjs    
    storage: npmjs

middlewares:
  audit:
    enabled: true

# log settings
logs:
  - { type: stdout, format: pretty, level: http }
  - { type: file, path: /verdaccio/storage/verdaccio.log, format: pretty-timestamped, level: debug }

experiments:
  # support for npm token command
  token: true

Environment information

System: OS: Linux 5.0 Alpine Linux undefined CPU: (8) x64 AMD Opteron™ Processor 6380 Binaries: Node: 10.16.3 - /usr/local/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 6.9.0 - /usr/local/bin/npm

Debugging output

  • $ NODE_DEBUG=request verdaccio display request calls (verdaccio <–> uplinks)
  • $ DEBUG=express:* verdaccio enable extreme verdaccio debug mode (verdaccio api)
  • $ npm -ddd prints:
  • $ npm config get registry prints:

Additional context

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
DanielRufcommented, Dec 30, 2019

Sounds good. Please let us know then what we can do to prevent or help others with this issue in the future (either by documenting it or solving it in verdaccio).

1reaction
viceicecommented, Dec 30, 2019

Not yet, sorry. Have a lot of other work to do. Maybe i can try it next year (begining).

Read more comments on GitHub >

github_iconTop Results From Across the Web

400 Bad Request on JWT Authentication - Postman community
Hello guys. A little help locating the root cause of this http 400 Error please. Setup is REST API NodeJs +Mysql .
Read more >
Get Bad request (status 400) using JWT Token in call to API
I am using JWT Auth. The same token I use connects ok on a GET. When I use the same token on a...
Read more >
ajax post request returns 400 Bad Request after refresh JWT ...
I am using Cookie Authentication with JWT Token as Claims for login authentication. I also have an AutoValidateAntiForgeryToken attribute on ...
Read more >
Getting 400 when accessing a API setup with JWT policy
You have created an API bound with JWT policy as described below and you get a 400 error code. Step 1: Create a...
Read more >
jwt/v1/auth/validate bad request 400 after migration
When I try to validate the jwt via jwt/v1/auth/validate it throws error 400 bad request. It was working perfectly on my localhost.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found