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] NZBGet doesn’t work with NGINX Basic Auth #64

Closed
theg00s3 opened this issue Jan 24, 2020 · 7 comments
Closed

[Bug] NZBGet doesn’t work with NGINX Basic Auth #64

theg00s3 opened this issue Jan 24, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@theg00s3
Copy link

Describe the Bug
NZBGet fails to authenticate

To Reproduce
Type in URL, username and password in the nzbget tab. Press “Test Connection”

Expected Behaviour
Connection succeeded

Versions
LunaSea version 0.4.0+1
NZBGet version 21.0

Additional context
Logs here: https://pastebin.com/vJr7y91N

@theg00s3 theg00s3 added the bug Something isn't working label Jan 24, 2020
@JagandeepBrar
Copy link
Owner

Hmm... In the logs I can see that it can successfully hit the host because you are getting HTTP status code 401.

[package:lunasea/logic/clients/nzbget/api.dart] [getStatus] [NZBGet: <POST> HTTP Status Code (401)] [Exception: null]

Status 401 means unauthorized, are you 100% sure that the username and password are correct? On that, do the username or password contain any special characters, such as symbols like @, !, #, etc.?

I was experiencing problems myself when using passwords with symbols, but I also was not able to login on the web GUI so I assumed it was a problem with NZBGet.

@theg00s3
Copy link
Author

This is what I get when NZBGet's authentication is disabled

@JagandeepBrar
Copy link
Owner

It still seems to be returning 401 Unauthorized continually. Do you have any authentication layer on top of NZBGet, maybe through NGINX or Apache?

@theg00s3
Copy link
Author

I do have an authentication layer with nginx, so my url is username:password@website.com, which works for Sonarr, Radarr and Lidarr

@JagandeepBrar
Copy link
Owner

I think this problem may be out of my control, because I already tried preventing this by passing the username and password to NZBGet by setting the "authorization" header in base64 in the request, seen here:

https://github.com/JagandeepBrar/LunaSea/blob/73eaa245284b33b2509228f7dd84b1c6291521e7/lib/logic/clients/nzbget/api.dart#L23-L27

If you look at the NZBGet API, they also support passing username and password in that same format (username:password@host), and I feel like these must be interfering with each other. I can't think of any other reason that it seems to be failing authentication if you are confident that the username and password combo are correct.

Can you see if it works if you disable the NGINX authentication layer?

@theg00s3
Copy link
Author

Disabling nginx's basic auth works, but strangely I didn't need a workaround when using NZBUnity which unfortunately doesn't release its source code.

@theg00s3
Copy link
Author

theg00s3 commented Jan 28, 2020

I got it working. Instead of putting the nginx credentials in the url, I put them into the username and password box in LunaSea.

So my URL is website.com and then the nginx credentials are in the nzbget credential boxes.

@theg00s3 theg00s3 changed the title [Bug] NZBGet doesn’t work [Bug] NZBGet doesn’t work with NGINX Basic Auth Jan 28, 2020
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

2 participants