GNOME Bugzilla – Bug 766563
Authenticate jobs which needs authentication
Last modified: 2018-03-01 15:36:56 UTC
When an application which prints something doesn't provide mechanism for entering authentication info the job is held until it is authenticated. This is mainly case for SMB printers (tested on Windows 7 here). gnome-settings-daemon should check whether reason for current job-state-changed event is job-hold-until-specified and get auth-info-required then (you can have a look at system-config-printer, they have this solved). Once we get the event it should be processed somehow. There are 2 options: 1) Offer an authentication dialog 2) Open Jobs dialog of gnome-control-center via which it will be possible to authenticate the job - maybe we still need this even if we'll decide to got with the first option Related bug for this is https://bugzilla.gnome.org/show_bug.cgi?id=758170 (this could be used for the gnome-control-center part)
Option 2 is much better. We don't really have any UI in gnome-settings-daemon.
Couldn't we just prompt a gnome-shell modal dialog asking for the authentication? (like we do for wifi passwords, for instance).
(In reply to Felipe Borges from comment #2) > Couldn't we just prompt a gnome-shell modal dialog asking for the > authentication? (like we do for wifi passwords, for instance). gnome-shell only pops up password requests from NM and gnome-keyring. Would we be saving the password in gnome-keyring?
(In reply to Bastien Nocera from comment #3) > (In reply to Felipe Borges from comment #2) > > Couldn't we just prompt a gnome-shell modal dialog asking for the > > authentication? (like we do for wifi passwords, for instance). > > gnome-shell only pops up password requests from NM and gnome-keyring. Would > we be saving the password in gnome-keyring? Yes, we could save it in keyring if user wants to. But we also need the password itself so we can authenticate the job.
(In reply to Marek Kašík from comment #4) > (In reply to Bastien Nocera from comment #3) > > (In reply to Felipe Borges from comment #2) > > > Couldn't we just prompt a gnome-shell modal dialog asking for the > > > authentication? (like we do for wifi passwords, for instance). > > > > gnome-shell only pops up password requests from NM and gnome-keyring. Would > > we be saving the password in gnome-keyring? > > Yes, we could save it in keyring if user wants to. But we also need the > password itself so we can authenticate the job. There's 2 problems with using a gnome-shell password prompt: - you'd need to add code in gnome-shell to handle this specific case - the modal dialogue should only show up in direct response to a user interaction. Is there going to be a clear connection between a user action and the password prompt showing up in this case?
(In reply to Bastien Nocera from comment #5) > (In reply to Marek Kašík from comment #4) > > (In reply to Bastien Nocera from comment #3) > > > (In reply to Felipe Borges from comment #2) > > > > Couldn't we just prompt a gnome-shell modal dialog asking for the > > > > authentication? (like we do for wifi passwords, for instance). > > > > > > gnome-shell only pops up password requests from NM and gnome-keyring. Would > > > we be saving the password in gnome-keyring? > > > > Yes, we could save it in keyring if user wants to. But we also need the > > password itself so we can authenticate the job. > > There's 2 problems with using a gnome-shell password prompt: > - you'd need to add code in gnome-shell to handle this specific case > - the modal dialogue should only show up in direct response to a user > interaction. Is there going to be a clear connection between a user action > and the password prompt showing up in this case? I think the case here is very similar to connecting to password-protected network. The user would Print to a printer which requires authentication and would be prompted for the credentials. I think there's a direct correlation.
Created attachment 367835 [details] Notification requesting authentication Here is a proposal of how the notification about a job requesting authentication could look like. It is very similar to other notifications we have there. It shows up once a job (typically a new one) changes its state to "pending-held" and set "job-state-reasons" attribute to "cups-held-for-authentication" or "job-hold-until" attribute to "auth-info-required". Clicking it (default action) opens gnome-control's Printers panel with jobs dialog on authentication page (see https://bugzilla.gnome.org/show_bug.cgi?id=758170#c2). I'll wait for designers opinion on this and will attach here the patch if accepted. Maybe we could also notify about jobs requiring authentication once gsd starts.
(In reply to Marek Kašík from comment #7) > Created attachment 367835 [details] > Notification requesting authentication > > Here is a proposal of how the notification about a job requesting > authentication could look like. It is very similar to other notifications we > have there. ... "Printing requires authentication" doesn't seem quite right, grammatically speaking - from a user point of view it's not the process that requires authentication but the printer itself. "test-printer Requires Authorization" could be a better heading, or "Printer Requires Authorization". The description could then be "Credentials required in order to print" or "Credentials required for "test-print"".
Created attachment 368725 [details] [review] Notify user about need for authentication This patch implements the notification which shows up if a job which needs authentication is created. Clicking the notification (default action) opens gnome-control-center's Printers panel with Jobs dialog which allows user to authenticate the jobs (https://bugzilla.gnome.org/show_bug.cgi?id=758170#c23).
Created attachment 368726 [details] Screenshot of the notification
Review of attachment 368725 [details] [review]: lgtm. Sorry for taking so long to review, but the setup for samba to trigger the job-held signals is quite hard. :) Setting as accepted-commit_after_freeze because I'm unsure whether the release freeze break approved in https://mail.gnome.org/archives/release-team/2018-February/msg00060.html covers this one bug too. Feel free to push if that's the case. Thanks for your patch! ::: plugins/print-notifications/gsd-print-notifications-manager.c @@ +432,3 @@ + notify_notification_close (notification, NULL); + + gboolean ret; IMO it would be safer to prefix the commandline with $BINDIR.
Comment on attachment 368725 [details] [review] Notify user about need for authentication (In reply to Felipe Borges from comment #11) > IMO it would be safer to prefix the commandline with $BINDIR. Thank you for the review. I've added the BINDIR there and got UI freeze exception approvals from Michael Catanzaro and Olav Vitters and string freeze exception approvals from Piotr Drąg and Alexandre Franke. I've pushed the patch to master branch.