AirPrint CUPS authentication
Hi,
I'm setting up a system with CUPS which should be able to print from multiple platforms including IOS. I am using Tea4Cups as well since the print server should run some scripts before the document is passed to the actual printer.
Everything is working fine in Windows and on a Blackberry smartphone using IPP.
I've setup AirPrint for CUPS using the python script from this github repository: https://github.com/tjfontaine/airprint-generate
How ever I can't get AirPrint to work with the Ipad. The Ipad is locating the AirPrint server just fine, it's just not authenticating right I think. As an example when selecting the printer in the browser, the Ipad locates it and displays a lock next to the printer name. How ever I'm not let with an option to enter the username and password. Pressing print the Ipad keeps retrying over and over again to print the document, which leads to the print server being flood with jobs.
In the CUPS access_log I'm getting a lot of 401 errors for the POST request made by the Ipad.
192.168.12.18 - - [04/Mar/2014:15:15:41 +0100] "POST /printers/Printer1 HTTP/1.1" 200 383 Validate-Job successful-ok
192.168.12.18 - - [04/Mar/2014:15:15:41 +0100] "POST /printers/Printer1 HTTP/1.1" 200 365 Create-Job successful-ok
192.168.12.18 - - [04/Mar/2014:15:15:41 +0100] "POST /printers/Printer1 HTTP/1.1" 401 3551 Send-Document successful-ok
192.168.12.18 - - [04/Mar/2014:15:15:42 +0100] "POST /printers/Printer1 HTTP/1.1" 200 383 Validate-Job successful-ok
192.168.12.18 - - [04/Mar/2014:15:15:42 +0100] "POST /printers/Printer1 HTTP/1.1" 200 365 Create-Job successful-ok
192.168.12.18 - - [04/Mar/2014:15:15:42 +0100] "POST /printers/Printer1 HTTP/1.1" 401 3551 Send-Document successful-ok
The error_log says
> cupsdAuthorize: No authentication data provided.
which is why I suspect the Ipad to not provide the auth information right or a misconfiguration of the CUPS AirPrint.
D [04/Mar/2014:15:28:15 +0100] cupsdSetBusyState: Dirty files
D [04/Mar/2014:15:28:27 +0100] cupsdAcceptClient: skipping getpeercon()
D [04/Mar/2014:15:28:27 +0100] cupsdAcceptClient: 13 from 192.168.12.18:631 (IPv4)
D [04/Mar/2014:15:28:27 +0100] cupsdReadClient: 13 POST /printers/Printer1 HTTP/1.1
D [04/Mar/2014:15:28:27 +0100] cupsdSetBusyState: Active clients and dirty files
D [04/Mar/2014:15:28:27 +0100] cupsdAuthorize: No authentication data provided.
D [04/Mar/2014:15:28:27 +0100] cupsdReadClient: 13 2.0 Get-Printer-Attributes 64
D [04/Mar/2014:15:28:27 +0100] Get-Printer-Attributes ipp://printserver.local.:631/printers/Printer1
D [04/Mar/2014:15:28:27 +0100] Returning IPP successful-ok for Get-Printer-Attributes (ipp://printserver.local.:631/printers/Printer1) from 192.168.12.18
D [04/Mar/2014:15:28:27 +0100] cupsdSetBusyState: Dirty files
D [04/Mar/2014:15:28:27 +0100] cupsdReadClient: 13 WAITING Closing on EOF
D [04/Mar/2014:15:28:27 +0100] cupsdCloseClient: 13
D [04/Mar/2014:15:28:34 +0100] cupsdAcceptClient: skipping getpeercon()
D [04/Mar/2014:15:28:34 +0100] cupsdAcceptClient: 13 from 192.168.12.18:631 (IPv4)
D [04/Mar/2014:15:28:34 +0100] cupsdReadClient: 13 OPTIONS * HTTP/1.1
D [04/Mar/2014:15:28:34 +0100] cupsdSetBusyState: Active clients and dirty files
D [04/Mar/2014:15:28:34 +0100] cupsdAuthorize: No authentication data provided.
D [04/Mar/2014:15:28:34 +0100] Connection from 192.168.12.18 now encrypted.
D [04/Mar/2014:15:28:34 +0100] cupsdSetBusyState: Dirty files
D [04/Mar/2014:15:28:34 +0100] cupsdReadClient: 13 POST /printers/Printer1 HTTP/1.1
D [04/Mar/2014:15:28:34 +0100] cupsdSetBusyState: Active clients and dirty files
D [04/Mar/2014:15:28:34 +0100] cupsdAuthorize: No authentication data provided.
D [04/Mar/2014:15:28:34 +0100] cupsdReadClient: 13 2.0 Validate-Job 1
D [04/Mar/2014:15:28:34 +0100] Validate-Job ipp://mksprintserver.local.:631/printers/Printer1
D [04/Mar/2014:15:28:34 +0100] Returning IPP successful-ok for Validate-Job (ipp://mksprintserver.local.:631/printers/Printer1) from 192.168.12.18
Below my cupsd.conf
MaxLogSize 0
#
# "$Id: cupsd.conf.in 8805 2009-08-31 16:34:06Z mike $"
#
# Sample configuration file for the CUPS scheduler. See "man cupsd.conf" for a
# complete description of this file.
#
# Log general information in error_log - change "warn" to "debug"
# for troubleshooting...
LogLevel debug
# Administrator user group...
SystemGroup sys root
# Only listen for connections from the local machine.
Listen 631
Listen /var/run/cups/cups.sock
# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseLocalProtocols CUPS
# Default authentication type, when authentication is required...
DefaultAuthType Basic
DefaultEncryption Never
# Restrict access to the server...
# For printing via AirPrint
ServerAlias *
<Location />
Order allow,deny
Allow localhost
Allow 192.168.0.0/18
</Location>
# Restrict access to the admin pages...
<Location /admin>
Order allow,deny
Allow localhost
Allow 192.168.0.0/18
</Location>
# Restrict access to configuration files...
<Location /admin/conf>
AuthType Basic
Require user @OWNER @SYSTEM
Order deny,allow
</Location>
# Set the default printer/job policies...
<Policy default>
# Job-related operations must be done by the owner or an administrator...
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document>
AuthType Basic
Order allow,deny
</Limit>
# All administration operations require an administrator to authenticate...
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
AuthType Default
Require user @SYSTEM
Order deny,allow
</Limit>
# All printer operations require a printer operator to authenticate...
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
AuthType Default
Require user @SYSTEM
Order deny,allow
</Limit>
# Only the owner or an administrator can cancel or authenticate a job...
<Limit Cancel-Job CUPS-Authenticate-Job>
Require user @OWNER @SYSTEM
Order deny,allow
</Limit>
<Limit All>
Order deny,allow
</Limit>
</Policy>
# Set the authenticated printer/job policies...
<Policy authenticated>
# Job-related operations must be done by the owner or an administrator...
<Limit Create-Job Print-Job Print-URI>
AuthType Basic
Order deny,allow
</Limit>
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document>
AuthType Basic
Order allow,deny
</Limit>
# All administration operations require an administrator to authenticate...
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
AuthType Default
Require user @SYSTEM
Order deny,allow
</Limit>
# All printer operations require a printer operator to authenticate...
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
AuthType Default
Require user @SYSTEM
Order deny,allow
</Limit>
# Only the owner or an administrator can cancel or authenticate a job...
<Limit Cancel-Job CUPS-Authenticate-Job>
AuthType Default
Require user @OWNER @SYSTEM
Order deny,allow
</Limit>
<Limit All>
Order deny,allow
</Limit>
</Policy>
#
# End of "$Id: cupsd.conf.in 8805 2009-08-31 16:34:06Z mike $".
#
What could be wrong? Are there really no option for authentication with the AirPrint server through IOS?
iPad