5

I am trying to create the user through owncloud User Provisioning API, when trying to request the below api:

curl -X POST http://admin:secret@localhost/owncloud/ocs/v1.php/cloud/users -d userid="user1" -d password="user1"

I get the response:

<?xml version="1.0"?>
<ocs>
 <meta>
  <status>failure</status>
  <statuscode>997</statuscode>
  <message>Unauthorised</message>
 </meta>
 <data/>
</ocs>
Nikhil Kinkar
  • 761
  • 8
  • 31
Gaurav Asai
  • 85
  • 11
  • Are you sure you're using the right `admin:secret` username/pass combination? That's the same error you get when the admin's password is incorrect. Also, make sure you're pointing to the right http/https endpoint as these might yield different results. You can test against `https://admin:admin@demo.owncloud.com` to see this working. – Alfageme Nov 13 '18 at 10:47

1 Answers1

3

That issue was causing due to the secret contained the combination of special character like @. Bellow is sample link

https://admin:secret@demo.owncloud.com

look like

https://admin:abc@12@demo.owncloud.com, where abc@12 is a secret/password.

Due to two @ symbol in secret, it was taking the domain from the @12 instead of @demo.

Nikhil Kinkar
  • 761
  • 8
  • 31
Gaurav Asai
  • 85
  • 11