Owncloudcmd on macOS does not authenticate automatically

When I launch the command line client on Mac OS X (10.9.5), it asks me username and password instead of using the credentials stored by the GUI client, as I read in the OC documentation:
https://doc.owncloud.org/desktop/2.3/advancedusage.html#credential-handling

I verified that the macOS keychain allows owncloudcmd to access the same redentials the full GUI app uses successfully.

I tested with the latest version of ownCloud Desktop Client (2.3.0). Here are relevant lines from the output of "owncloudcmd /Users/demo/ownCloud/Documents https://server.mydomain.com/remote.php/webdav/Documents":

OCC::DiscoveryJob(0x7fe5d261ae20)  Calling into main thread...
!!! OCC::LsColJob created for "https://server.mydomain.com" + "/Documents" "OCC::DiscoverySingleDirectoryJob"
void OCC::AbstractNetworkJob::slotFinished() QNetworkReply::NetworkError(AuthenticationRequiredError) "Host requires authentication" QVariant(int, 401)
void OCC::DiscoverySingleDirectoryJob::lsJobFinishedWithErrorSlot(QNetworkReply *) "Host requires authentication" 401 QNetworkReply::NetworkError(AuthenticationRequiredError)
void OCC::DiscoveryMainThread::singleDirectoryJobFinishedWithErrorSlot(int, const QString &) 1 "Host requires authentication"
OCC::DiscoveryJob(0x7fe5d261ae20)  ...Returned from main thread
1 when opening  msg= "Host requires authentication"
[4] csync_ftw  opendir failed for  - errno 1
[6] csync_statedb_close  sqlite3_close=0
 #### ERROR during  csync_update :  "CSync failed due to unhandled permission denied. Host requires authentication"
void OCC::SyncJournalDb::close() "/Users/demo/ownCloud/Documents/._sync_beced333bc1e.db"

Since this feature is pretty important for me, I'd like to know if it's a bug and eventually who can help me to fix it (I'd like to sponsor his/her work, obviously).

Sincerely.

Hi @andrewhotlab, you are absolutely right; this looks either a regression on the client (maybe introduced after multi-account support) or a documentation outdated. I will try to figure it out and report back with an issue on the client repository to solve it.

As a workaround in the meantime, you can hardcode your username:password in the server URL to avoid the client being interactive if you are trying to call it from a cronjob/script.

Thanks for reporting!

Issue for tracking:

Thank you so much Samuel. Following up the discussion about the issue on GitHub, if the command line client never supported the automatic auth by using Apple's Keychain, I wish to submit a feature request for enabling it. I really need that feature and, since I'm not able to write it myself, I'd like to sponsor the work of anyone who have the competencies to add this feature.
As for the way to match credentials with OC account, maybe the username@URL tuple can be used to refer it univocally?

1 Like

You can post feature requests directly to [1] where such kind of requests are tracked.

[1]

Thank you. I just posted the request on GitHub:

1 Like