n4bb12 / verdaccio-github-oauth-ui

📦🔐 GitHub OAuth plugin for Verdaccio
https://verdaccio.org
MIT License
73 stars 45 forks source link

htpasswd users can't login via npm if github-oauth-ui is active #140

Closed hybridherbst closed 2 years ago

hybridherbst commented 2 years ago

Bug Report

Verdaccio auth plugins usually fall back gracefully in the order of declaration, however, it seems that github-oauth-ui blocks access to htpasswd (the default auth plugin).

Expected behavior

When logging in via npm with a user:password combination that is registered in the htpasswd file, user can log in.

Observed behaviour

Some logs appear that github-oauth-ui tries to add the user, which fails since it exists, and the user can't log in.

Steps to reproduce

  1. Make sure htpasswd auth and github-oauth-ui are both on
  2. Try to log in via npm login with a user:password combination as set in htpasswd
  3. Note the logs on the server that the user can't be created and hasn't successfully logged in
n4bb12 commented 2 years ago

I tried it out and verified that both authentication methods (this plugin + htpasswd) can be used together.

I think the plugin already does this correctly. It was looked at before in the past and fixed here: https://github.com/n4bb12/verdaccio-github-oauth-ui/issues/17.

Please make sure you are using the plugin as described in the README including the hints in the troubleshooting section.

After checking the README if you still think there is an issue, please share your configuration and Verdaccio logs. I'll be more than happy to try again or identify the issue.

n4bb12 commented 2 years ago

You can see this correctly implemented here and the relevant docs here.