Change Password in Video Client

Hi

I am trying to create a Plugin for the Videoclient to allow a Basic User to change his Password.

Im Starting with the “AddUserWithConfigApi” Sample and trying to modify it. Unfortunately without success.

I started with the “CreateUser” Method and did modify it like this:

private string ChangePasswordBasicUser(IConfigurationService configurationApiClient, string password)
        {
            string userFolderPath = string.Format("/{0}", ItemTypes.BasicUserFolder);
 
            var userFolder = configurationApiClient.GetItem(userFolderPath);
            var changePasswordBasicUserInvokeInfo = configurationApiClient.InvokeMethod(userFolder, "ChangePasswordBasicUser");
 
            // Changing the properties of the invokeInfo object to the provided parameters
            var passwordProperty = changePasswordBasicUserInvokeInfo.Properties.Where(property => property.Key == "Password").FirstOrDefault();
            passwordProperty.Value = password;
 
            // Calling the AddBasicUser method on BasicUserFolder again with the prepared invokeInfo object
            var changePasswordBasicUserInvokeResult = configurationApiClient.InvokeMethod(changePasswordBasicUserInvokeInfo, "ChangePasswordBasicUser");
 
            return changePasswordBasicUserInvokeResult.Path;
        }

I get this error:

The path is not a valid/recognized path.

Details:

Invalid path. Path: /BasicUserFolder

Parametername: item

Is there any Sample on how to make this work?

You need to call the method on an item representing an actual basic user - not the basic user folder. So either you should traverse the children of the folder item to find the right user or you should open the user item directly using a path like this:

BasicUser[GUID]

The change basic user password method should not even exist on the folder level, so we will fix this for the next release. Sorry for the inconvenience.

Thank you very much. Works now perfectly.

Now, is it possible to add an option to this Menu?:

Could not find any Sample to do that.

Since this is quite unrelated to your previous question I would normally ask you to post it in a separate thread to make it easier for others to find, so please do that next time.

You cannot add to that specific menu, but you can add your own buttons to the toolbar right below the menu. Look at the “Smart Client Toolbar Plug-in” sample. You can also add you own tab to the Settings dialog - look at the “Smart Client Settings Panel Plug-in” sample.

Your right, sorry for that.

Thank you anywhay for the response.