BenoitDuffez / AndroidCupsPrint

Port of cups4j to Android. Allows wireless printing from any Android device to any CUPS-enabled print server or network printer.
https://benoitduffez.github.io/AndroidCupsPrint
GNU Lesser General Public License v3.0
228 stars 66 forks source link

Password protected printer not reachable #179

Open Sasso0101 opened 4 years ago

Sasso0101 commented 4 years ago

Hi! I have a password protected CUPS server (since it's exposed to the internet) as follows: <Location /> AuthType Default Require user @SYSTEM Order allow,deny Allow all </Location> Printing from Windows and Linux works just fine but when I try to manually add the printer through Android CUPS Print it just adds it to the printer list without asking for any username or password. Also, when I select the printer and try to print from it the Android print window says that the printer is not available right now (I think something times out because it takes a few seconds before the message appears). I haven't seen any errors in the CUPS logs (the log level is set to error: LogLevel error). I'm running the app on Android 10, if that makes any difference. The connection to the CUPS server is https, with a valid certificate. Thanks for the your time and patience spent to make this app and of course I would be really happy to help you with the troubleshooting. :)

pholcroft commented 4 years ago

I came here to post this exact same issue. I have set mine up behind HAProxy with Basic HTTP Authentication. It works fine in Windows 10 as you say, just asking for the username and password, but on Android I have exactly the same experience as you. I don't see how else we can allow it to have access from the internet while being secure unless I am missing some other method?

Edit: I've had a look at the code and it's clear this feature is in there, but for some reason it's not working... BasicAuthActivity.kt