server icon indicating copy to clipboard operation
server copied to clipboard

Remote API-calls fails

Open ixmann99 opened this issue 9 years ago • 2 comments

Steps to reproduce

When requesting raw requests to API it always return http 401 unauthenticated, despite using correct username, password and auth method

Just send a raw request, with the admin-user:

curl https://admin:somepass@URL/ocs/v1.php/cloud/users -H "OCS-APIRequest: true"

failure 997 Current user is not logged in

The developers at HostBill, with their OwnCloud-module, have verified the issue in NextCloud. They say the API-call fails each time and I have manually tried the method above too. Have tested with other admin-accounts as well.

Expected behaviour

Return the objects asked for - anything but failture.

Actual behaviour

http 401 unauthenticated

Server configuration

Centos 7

Web server: cPanel

Database: MariaDB

PHP version: 7.0

Nextcloud version: (see Nextcloud admin page) 12.0.0

Updated from an older Nextcloud/ownCloud or fresh install: No.

Where did you install Nextcloud from: cPanel.

Signing status:

No errors have been found.

Are you using external storage, if yes which one: local/smb/sftp/... No.

Are you using encryption: yes/no No.

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... No.

ixmann99 avatar Jul 04 '17 17:07 ixmann99

parallel discussion in the forum: https://help.nextcloud.com/t/api-broken-in-nextcloud/15099

tflidd avatar Jul 19 '17 09:07 tflidd

Works totally fine here:

curl -u admin:admin http://URL/ocs/v1.php/cloud/users -H "OCS-APIRequest: true"
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>100</statuscode>
  <message>OK</message>
  <totalitems></totalitems>
  <itemsperpage></itemsperpage>
 </meta>
 <data>
  <users>
   <element>admin</element>
   <element>test</element>
   <element>test2</element>
  </users>
 </data>
</ocs>

Maybe the password contains a wrongly encoded password and fails due to this?

And the forum post shows that it is problem in their (HostBill) code of a Nextcloud app.

Closing

MorrisJobke avatar Aug 14 '17 15:08 MorrisJobke