cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to delete users using web service

adamss
Champ in-the-making
Champ in-the-making
I am trying to use the web service to create and delete users. I've noticed that if I try to recreate a user that has already been deleted (using the web service) I get a duplicate user exception. I also noticed that the following entry in the node_properties table is still available for users that I've deleted using the web service:

node_id        actual_type        string_value         qname
614      STRING      alfrescotestuser3@test.com   {http://www.alfresco.org/model/user/1.0}username

After looking at the code for AdministrationWebService.createUsers() and AdministrationWebService.deleteUsers(), I found that AdministrationWebService.createUsers() contains a call to authenticationService.createAuthentication() and a call to personService.createPerson(). However, AdministrationWebService.deleteUsers() only calls personService.deletePerson() - it does not delete the authentication for that user. This, I believe, is the source of the duplicate user exception that is thrown if I try to create another user with the same username. I've also included an example below of how I am using the web service. Am I using it incorrectly? Is this a known problem with the web service?

I'm using alfresco v1.3

Any advice would be greatly appreciated!

my code:
createAlfrescoUser() {   …      AuthenticationUtils.startSession(USER,PASSWORD);   NewUserDetails[] newUsers = new NewUserDetails[] {         new NewUserDetails(                 username,                 password,                              new NamedValue[] {                     new NamedValue(Constants.PROP_USER_EMAIL, false,email,null),                      new NamedValue(Constants.PROP_USER_FIRSTNAME, false,"bogus",null),                      new NamedValue(Constants.PROP_USER_LASTNAME, false,"bogus",null)}                 )};   WebServiceFactory.getAdministrationService().createUsers(newUsers);   AuthenticationUtils.endSession();      …}deleteAlfrescoUser() {   …      AuthenticationUtils.startSession(USER,PASSWORD);   WebServiceFactory.getAdministrationService().deleteUsers(new String[] {usernameToDelete});   AuthenticationUtils.endSession();      …   }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
5 REPLIES 5

rwetherall
Confirmed Champ
Confirmed Champ
I've responded in this article http://forums.alfresco.com/viewtopic.php?t=1600

adamss
Champ in-the-making
Champ in-the-making
Thanks for the update rwetheral. In the meantime, do you know how I can remove these orphan authentication records? I have some users who were deleted using the web service and now need to be recreated (using their original usernames). Some of these users have also created content. Is there a way I can remove the authentication records from the database so that alfresco will not throw a duplicate user exception when I try to recreate the user?

Thanks in advance for your help!

lorel
Champ in-the-making
Champ in-the-making
If you login in alfresco with the user's login and password, you'll could find it in alfresco admin panel.

Sorry for my english  :lol:

sergio
Champ in-the-making
Champ in-the-making
Hi all.

Lorel, I think adamss would like to completely remove the user from the repository via web services and, more in general, programatically and not using the control panel for the administrator.

I have the same problem, it could be great if someone tell us the best way to remove the orphan authentication records.

Would it be enough to delete the orphan record from the alf_nodes database table? Are there any other references to the user inside different tables?

Many thanks to all.

All the best,

Sergio

andy
Champ on-the-rise
Champ on-the-rise
Hi

Duplicate users are handled in 2.0. (Duplicates will be split, deleted, or one picked …)

Regards

Andy
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.