User Provisioning API - changing user info

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

User Provisioning API - changing user info

coreymj
Hi All,

I'm trying to change user information via the User Provisioning API on our OwnCloud 8.1.4-12.1 server, running on Centos7 x64.  The call is successful (i.e. no errors), but the user's display name, email, etc., do not change.

I wrote the code first in PHP, where it doesn't work, but I am able to replicate this in cUrl from the command line:

$ curl "https://admin:admin@localhost/owncloud/ocs/v1.php/cloud/users/juser" -d key="display",value="Joe User" -k

Nothing is returned and nothing is changed that I can see in the ownCloud GUI.  I have verified that I have all the connectivity bits set up:

$ curl "https://admin:admin@localhost/owncloud/ocs/v1.php/cloud/users" -k

<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>100</statuscode>
  <message/>
 </meta>
 <data>
  <users>
   <element>admin</element>
   <element>juser</element>
  </users>
 </data>
</ocs>

Any advice would be appreciated!

Thanks!
Corey.
Reply | Threaded
Open this post in threaded view
|

Re: User Provisioning API - changing user info

Arman Khalatyan-2

There is a typo in documentation  you should use:
curl "https://admin:admin@localhost/owncloud/ocs/v1.php/cloud/users/juser"
-d key="display" -d value="Joe User" -k

Am 20.11.2015 20:21 schrieb "coreymj" <[hidden email]>:
Hi All,

I'm trying to change user information via the User Provisioning API on our
OwnCloud 8.1.4-12.1 server, running on Centos7 x64.  The call is successful
(i.e. no errors), but the user's display name, email, etc., do not change.

I wrote the code first in PHP, where it doesn't work, but I am able to
replicate this in cUrl from the command line:

$ curl "https://admin:admin@localhost/owncloud/ocs/v1.php/cloud/users/juser"
-d key="display",value="Joe User" -k

Nothing is returned and nothing is changed that I can see in the ownCloud
GUI.  I have verified that I have all the connectivity bits set up:

$ curl "https://admin:admin@localhost/owncloud/ocs/v1.php/cloud/users" -k

<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>100</statuscode>
  <message/>
 </meta>
 <data>
  <users>
   <element>admin</element>
   <element>juser</element>
  </users>
 </data>
</ocs>

Any advice would be appreciated!

Thanks!
Corey.



--
View this message in context: http://owncloud.10557.n7.nabble.com/User-Provisioning-API-changing-user-info-tp16112.html
Sent from the Developers mailing list archive at Nabble.com.
_______________________________________________
Devel mailing list
[hidden email]
http://mailman.owncloud.org/mailman/listinfo/devel

_______________________________________________
Devel mailing list
[hidden email]
http://mailman.owncloud.org/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: User Provisioning API - changing user info

coreymj
Thanks for the reply!

Changing to

curl "https://admin:admin@localhost/owncloud/ocs/v1.php/cloud/users/juser" -d key="display" -d value="Joe User" -k

Did not appear to make any difference in the outcome - the 'Full Name' did not change in the GUI.

Corey.

Reply | Threaded
Open this post in threaded view
|

Re: User Provisioning API - changing user info

coreymj
Ok - I found out some more information on my attempt to change a user's display name via the User Provisioning API.  After accounting for a type in the documentation, this is what my curl query looks like:

curl "https://admin:admin@localhost/owncloud/ocs/v1.php/cloud/users/juser" -d key="display" -d value="Joe User" -k -v

Then I discovered the '-v' param, and sure enough:

> POST /owncloud/ocs/v1.php/cloud/users/juser HTTP/1.1
...
< HTTP/1.1 405 Method Not Allowed
...

Anyone have an idea why this is not allowed?

Thanks!
Corey.
Reply | Threaded
Open this post in threaded view
|

Re: User Provisioning API - changing user info

Alessandro Cosentino
Right now you're sending a POST. Try to add '-X PUT' as option of your
curl command.

Alessandro

On Sat, Nov 21, 2015 at 12:15 AM, coreymj <[hidden email]> wrote:

> Ok - I found out some more information on my attempt to change a user's
> display name via the User Provisioning API.  After accounting for a type in
> the documentation, this is what my curl query looks like:
>
> curl "https://admin:admin@localhost/owncloud/ocs/v1.php/cloud/users/juser"
> -d key="display" -d value="Joe User" -k -v
>
> Then I discovered the '-v' param, and sure enough:
>
>> POST /owncloud/ocs/v1.php/cloud/users/juser HTTP/1.1
> ...
> < HTTP/1.1 405 Method Not Allowed
> ...
>
> Anyone have an idea why this is not allowed?
>
> Thanks!
> Corey.
>
>
>
> --
> View this message in context: http://owncloud.10557.n7.nabble.com/User-Provisioning-API-changing-user-info-tp16112p16115.html
> Sent from the Developers mailing list archive at Nabble.com.
> _______________________________________________
> Devel mailing list
> [hidden email]
> http://mailman.owncloud.org/mailman/listinfo/devel
_______________________________________________
Devel mailing list
[hidden email]
http://mailman.owncloud.org/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

User Provisioning API - throttle consecutive calls?

Corey Wirun
Hi All,

I'm synchronizing a web portal system user base with OwnCloud 8.1.5.  To
ease the initial deployment, I created scripts to migrate users from the
portal system to OwnCloud - using the User Provisioning API to create
the users, assign groups, etc., etc.

As part of my testing, I'm creating 2 users.  I've noticed some
inconsistency that sometimes one of the users does not get created in
OwnCloud after my script runs.  Sometimes both users get created,
sometimes user1 is missing, other times user2 is missing.

It's not as if there's a delay in creating both users, a user just gets
lost and there are no errors returned by any User API calls.

Introducing a delay of a 4-5 seconds between consecutive User API calls
'appears' to make things work better, but for 100's of users it will add
a significant delay not only during the initial deployment, but also in
the daily management of user changes in the source system.

Is this an issue?  I made the (perhaps incorrect) assumption that the
User API calls are synchronous...

Thanks for any advice.  Happy New Year!

Corey.


_______________________________________________
Devel mailing list
[hidden email]
http://mailman.owncloud.org/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: User Provisioning API - throttle consecutive calls?

Roeland Douma
Hey,

The calls are synchronous. So you assumed correctly.

Do you check the response in your script? Something can of course go wrong. But
the API *should* tell you that.

Cheers,
--Roeland

From: Corey Wirun <[hidden email]>
To: <[hidden email]>
Sent: 4-1-2016 19:17
Subject: [owncloud-devel] User Provisioning API - throttle consecutive calls?

Hi All,

I'm synchronizing a web portal system user base with OwnCloud 8.1.5.  To
ease the initial deployment, I created scripts to migrate users from the
portal system to OwnCloud - using the User Provisioning API to create
the users, assign groups, etc., etc.

As part of my testing, I'm creating 2 users.  I've noticed some
inconsistency that sometimes one of the users does not get created in
OwnCloud after my script runs.  Sometimes both users get created,
sometimes user1 is missing, other times user2 is missing.

It's not as if there's a delay in creating both users, a user just gets
lost and there are no errors returned by any User API calls.

Introducing a delay of a 4-5 seconds between consecutive User API calls
'appears' to make things work better, but for 100's of users it will add
a significant delay not only during the initial deployment, but also in
the daily management of user changes in the source system.

Is this an issue?  I made the (perhaps incorrect) assumption that the
User API calls are synchronous...

Thanks for any advice.  Happy New Year!

Corey.


_______________________________________________
Devel mailing list
[hidden email]
http://mailman.owncloud.org/mailman/listinfo/devel

_______________________________________________
Devel mailing list
[hidden email]
http://mailman.owncloud.org/mailman/listinfo/devel