ubports / account-plugins

Moved to https://gitlab.com/ubports/core/indicator-transfer
https://gitlab.com/ubports/core/indicator-transfer
GNU General Public License v2.0
3 stars 6 forks source link

Nextcloud App password #1

Closed ernesst closed 7 years ago

ernesst commented 7 years ago

The way the check is performed to ensure credential validity is not correct for an app. password as per Nextcloud spec. ( I dont know for owncloud) As per my question to nextcloud https://github.com/nextcloud/server/issues/6626

According to them we should check with : GET and host + "/ocs/v2.php/cloud/user"

I modified the plugin to :

var body = host + "/ocs/v2.php/cloud/user"; request.open("GET", body, true); request.setRequestHeader("Authorization", "Basic " + username + ":" + password) request.setRequestHeader("OCS-APIRequest", "true"); request.send(null);

But Nextcloud server doesn't recognize the user when i test like that, while with a curl it's working fine. According to this the username and password should be encoded : https://support.zendesk.com/hc/en-us/community/posts/213175107-Issues-authenticating-via-a-Chrome-extension-javascript-using-XMLHttpRequest-

When I try this : btoa(username + ":" + password) I got ReferenceError: btoa is not defined

Thanks

Flohack74 commented 7 years ago

Fixed in upstream (#3).