Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Basic auth applied on reverse proxy breaks frontend #683

Open
ivancarlosti opened this issue Aug 9, 2024 · 3 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@ivancarlosti
Copy link

ivancarlosti commented Aug 9, 2024

Describe the bug
When basic auth is enabled on nginx reverse proxy, it breaks Yacht frontend. The login screen returns
: Bad Authorization header. Expected value 'Bearer <JWT>'
on login form after submission.

To Reproduce
Steps to reproduce the behavior:

  1. Enable basic authentication on nginx reverse proxy
  2. Open frontend URL
  3. Try to login
  4. See error

Expected behavior
It's expected to run smoothly without error

Screenshots
image

image

Desktop (please complete the following information):

  • OS: Ubuntu 24 Server
  • Browser Chrome
  • Yacht Version v0.0.7-alpha-2023-01-12--05
@ivancarlosti ivancarlosti added the bug Something isn't working label Aug 9, 2024
@wickedyoda
Copy link
Collaborator

What docker container are you using for nginx? I run linuxserver/nginx:latest and I would have to check my config for the options I have enabled. But I also dont do Auth through Nginx, I let nginx manage my ssl cert and auth is done in yacht.

@wickedyoda wickedyoda self-assigned this Aug 9, 2024
@ivancarlosti
Copy link
Author

ivancarlosti commented Aug 10, 2024

What docker container are you using for nginx? I run linuxserver/nginx:latest and I would have to check my config for the options I have enabled. But I also dont do Auth through Nginx, I let nginx manage my ssl cert and auth is done in yacht.

My nginx is not in a container, it comes from CloudPanel installed directly on host OS. It runs very fine without basic auth, my problem is that I want to expose Yacht on the internet but the Yacht login form is insecure, there is no protection layer, 2FA or capcha to avoid bruteforce, so I would like to use basic auth or any other protection layer to protect it.

@ahobsonsayers
Copy link

I have had this exact issue in the past, but with treafik and basic auth instead of nginx.

It took me a while to find the solution, but eventually discovered that you need to make sure the Authorization header is not being forwarded by your proxy to Yacht.

In traefik this can be done using removeHeader in the basic auth middleware configuration options (docs here).

How you doing this in nginx I am not sure, but if feel pretty certain if you do this, your issue will be resolved.

Hope I helped!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants