Page 1 of 1

Create user programmatically

Posted: Tue Nov 22, 2011 2:51 pm
by cschulz
Hello,

I am trying to create user programmatically. I searched the Java API, but I can't find anything.
The ProjectWebservice offers the method createUser, but there is no possibility to set a password.
Is there any possibility to create user?

Thanks for any advices.

Re: Create user programmatically

Posted: Thu Dec 01, 2011 7:38 am
by NickEntin
Hi,

I believe something like that is not really implemented in Polarion - customers typically are very careful about users because of licenses and bulk creation of users is not considered scenario so far.

What do you like to achieve at the end?

E.g. LDAP integration of Polarion + User Autocreation allows you to configure Polarion the way that any authenticated user will be automatically created in the system with preconfigured roles/permissions.
To cover this scenario you need to program how to create this user in Apache, LDAP or any other authentication mechanism you use with Polarion.

Please note that the "semantic" user in Polarion (i.e. you can use his name in Assignee or similar fields) will be created only after successfull login attempt, and not right after insertion of an entry in Apache/LDAP.

Best regards,
Nick

Re: Create user programmatically

Posted: Thu Dec 01, 2011 8:20 am
by cschulz
It's a pity, that there is no way with the API to create user.
The most easiest way to create user is to create the userfolder in user-management/users and add the roles in file security/user-roles.xml.
After that the user is created. For login you have to add the user to the specified files like passwd and access.

Re: Create user programmatically

Posted: Tue Dec 06, 2011 2:05 pm
by NickEntin
As I wrote above, you don't need to create folders or programmatically modify user-roles.xml - this might be configured once as default and used for any new user.
As soon as user is authenticated - those folders/files will be created updated.

This is what's called "user autocreation" in Polarion.

Of course you need to create record in passwd/access, but instead you can use LDAP, as I described before...

Best regards,
Nick

Re: Create user programmatically

Posted: Tue Dec 06, 2011 4:49 pm
by cschulz
Yeah but I want to control, which user can login.
I can't use LDAP authentication, because I have no AD or anything like that.
There is only an user database at a mysql server and this one I want to use.

Re: Create user programmatically

Posted: Wed Dec 14, 2011 8:48 am
by NickEntin
It doesn't matter - create user in passwd/access file by batch or other mean and the roles in Polarion will be set automatically.

Best regards,
Nick

Re: Create user programmatically

Posted: Wed Dec 14, 2011 9:03 am
by cschulz
When it is created?
I have the problem, if you don't create the roles in the file, you can't login.

Re: Create user programmatically

Posted: Wed Dec 14, 2011 9:10 am
by NickEntin
Please read carefully about auto-creation of users. If you need assistance, please approach support.

http://almdemo.polarion.com/polarion/help/?topic=/com.polarion.xray.doc.user/agchUsersPermissions.html, section "Configuring User Auto-create"

Best regards,
Nick

Re: Create user programmatically

Posted: Tue Feb 14, 2012 11:38 am
by cschulz
Thanks for the information, but so it would be possible, that external users can login.
I think I found a better solution over the SSO, but how can I synchronize mail address and something like that?

Is there any possibility to write my own synchronize system based on the LDAP system?

Re: Create user programmatically

Posted: Tue Feb 14, 2012 2:13 pm
by NickEntin
Hi,

Sorry, it looks like I'm out of context again.
You can synchronize users in Polarion directly with LDAP - one-time (or more times) synchronization. Why do you need to write another script?

May be it makes sense to move our discussion to a different level - please speak to your Polarion rep. He should connect you to our Professional Services, they check your needs and offer the best practice or even development solution for you (in form of a small example, if you prefer).

Best regards,
Nick

Re: Create user programmatically

Posted: Wed May 17, 2017 5:10 pm
by dan7777777
Hello, have there been any improvements on this functionality? I am also trying to create a local user automatically and right now the methods from ISecurityService and IProjectService aren't doing anything (or not working as intended). Thank you!

Re: Create user programmatically

Posted: Sat Jul 07, 2018 4:08 am
by Muneera123
I don't know how to create user pro grammatically single step also why because i am not a developer.....let me know anyone about this topic.....

ISO 9001 Consultancy in Singapore

ISO Consultant in Philippines