You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Encryption makes files inaccessible for app APIs #8830
As described in owncloud/notes#48 encryption prevents an API from accessing files, in this particular case the Notes app. Users are met with a 401 Unauthorized even though credentials are correct.
You are right, it's not decryption that is needed. For some reason using my iOS code I actually get a 404 with the GET api calls when encryption is turned on. It works fine without ownCloud encryption. PUT for updating a note sort of works. The server gets the new data correctly but there is no json returned. Is something altered in the routes? Is there a specific header needed? I would think not since it works for me also using a REST client app in Firefox.
Developers: I have successfully used curl to login and receive the encrypted notes from my owncloud by calling:
curl --data "user=[USERNAME]&password=[PASSWORD]" -c- https://[OWNCLOUD-URL]/index.php -g https://[OWNCLOUD-URL]/index.php/apps/notes/api/v0.2/notes
It seems that there is a redirection happening after posting the login data (no basic or digest auth used here!). The second request will use a HTTP GET to fetch the data using the contents of that cookie (use -c cookie.txt instead of -c- to store it in a file). I believe, that MyOwnNotes does not do it that way, probably not following that redirection. Also note, that owncloud has an option in it's config.php, which might automatically lead to an unexpected redirection which is 'forcessl' => true
For me, your curl command results in a POST that creates a new note. If I add a note id at the end curl --data "user=[USERNAME]&password=[PASSWORD]" -c- https://[OWNCLOUD-URL]/index.php -g https://[OWNCLOUD-URL]/index.php/apps/notes/api/v0.2/notes/[NOTE_ID]
I get the note back, but ONLY if encryption is disabled.
Activity
PVince81 commentedon Jun 3, 2014
Maybe the notes app is not using the right API calls to access files. It should use the
Viewclass.If it does, please provide the logs ideally using the issue template: https://raw.github.com/owncloud/core/master/issue_template.md
CC @schiesbn @Raydiation
BernhardPosselt commentedon Jun 3, 2014
Notes APP uses the view class
phedlund commentedon Jun 3, 2014
Steps to reproduce
Expected behaviour
json with all your notes should be returned
Actual behaviour
401 Unauthorized is returned
Server configuration
CentOS:
Web server: Apache
Database: MySQL
PHP version: 5.3
ownCloud version: 6.0.3 (see ownCloud admin page)
Updated from an older ownCloud or fresh install: Updated
List of activated apps: Stock + News and Notes
The content of config/config.php:
Are you using external storage, if yes which one: No local/smb/sftp/...
Are you using encryption: Yes
PVince81 commentedon Jun 20, 2014
I don't think the 401 Unauthorized is raised by the encryption app.
Could be something else.
karlitschek commentedon Jun 24, 2014
@Raydiation So have you tested the notes app with encryption or do you know if someone else who used it successfully?
BernhardPosselt commentedon Jun 24, 2014
Ive tested it locally right now, works perfectly fine.
phedlund commentedon Jun 24, 2014
Locally as in the web interface? This issue is about the api accessed by https.
BernhardPosselt commentedon Jun 24, 2014
yes, via the API using postman chrome app
phedlund commentedon Jun 25, 2014
OK, I have to decrypt the data myself. Is seems the blowfish algorithm is used, correct? How do I get the key for decryption, or what else do I need?
BernhardPosselt commentedon Jun 25, 2014
Decrypt? Should be done for you when accessing the api
phedlund commentedon Jun 26, 2014
You are right, it's not decryption that is needed. For some reason using my iOS code I actually get a 404 with the GET api calls when encryption is turned on. It works fine without ownCloud encryption. PUT for updating a note sort of works. The server gets the new data correctly but there is no json returned. Is something altered in the routes? Is there a specific header needed? I would think not since it works for me also using a REST client app in Firefox.
urenzel commentedon Jul 7, 2014
Developers: I have successfully used curl to login and receive the encrypted notes from my owncloud by calling:
curl --data "user=[USERNAME]&password=[PASSWORD]" -c- https://[OWNCLOUD-URL]/index.php -g https://[OWNCLOUD-URL]/index.php/apps/notes/api/v0.2/notes
It seems that there is a redirection happening after posting the login data (no basic or digest auth used here!). The second request will use a
HTTP GETto fetch the data using the contents of that cookie (use-c cookie.txtinstead of-c-to store it in a file). I believe, that MyOwnNotes does not do it that way, probably not following that redirection. Also note, that owncloud has an option in it's config.php, which might automatically lead to an unexpected redirection which is'forcessl' => truephedlund commentedon Jul 7, 2014
For me, your curl command results in a POST that creates a new note. If I add a note id at the end
curl --data "user=[USERNAME]&password=[PASSWORD]" -c- https://[OWNCLOUD-URL]/index.php -g https://[OWNCLOUD-URL]/index.php/apps/notes/api/v0.2/notes/[NOTE_ID]I get the note back, but ONLY if encryption is disabled.