Page 1 of 1

Editing Vault users through API

Posted: Mon Jul 28, 2014 3:45 pm
by Balthazor
Hi, we need to update all our Vault user names and I'd like to write a quick utility to do this rather than having to manually change all the user names in the Vault Admin tool. I've got it to where it will change the user login, but the login will not work until I go into the Admin tool, open the new user and save it from there.

The code I've got which performs the update looks like this (vU is a VaultUser object):

vU.Login = NewLoginName;
bReturn = this.client.Connection.EditUser(vU);

Just wondering what else it is I need to do to make this work. Thanks!

Re: Editing Vault users through API

Posted: Tue Jul 29, 2014 8:13 am
by jclausius
How are you managing the Login process? Are you using the VaultClientIntegration wrappers?

The reason I ask, is I don't know how that will work. The Edit User API is found in the Admin Web Services. To get there through the API, the Client Instance needs to be initialized with AccessLevelType.Admin.

I think there is a Login() command which lets you specify Admin Access level, make sure to use AccessLevelType.Admin.

Re: Editing Vault users through API

Posted: Tue Jul 29, 2014 4:07 pm
by Balthazor
Well I got it to mostly work. Yeah I am logging in with the AccessLevelType.Admin to access the user list, what I needed to do was to update the password along with the login name. All I can seem to do is null the password since the API doesn't seem to want to retrieve the existing password from the system, but that's ok for our purposes since none of our users besides the Admin user has a password anyhow.

Re: Editing Vault users through API

Posted: Wed Jul 30, 2014 7:55 am
by jclausius
Glad you got it working.

BTW, if you set the VaultUser's Password member to null, it should remain unchanged through the call to EditUser().