How i create an users in bonita?
Hi everybody ,
how i create an users in bonita ? can i create an users with mysql sintax, because i inserted an user with mysql sintax , like this:
INSERT INTO bonita
.user_
(tenantid
, id
, enabled
, userName
, password
, firstName
, lastName
, title
, jobTitle
, managerUserId
, iconName
, iconPath
, createdBy
, creationDate
, lastUpdate
) VALUES ('1, '23', '1', 'james','123', james, larson, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
and , when i enter in bonita portal i don't see this user.
thanks in advanced.
I wouldn't do this (SQL) at all,
BonitaSoft don't support any manipulation of the User Database so be careful you don't screw it up. they also don't support the creation and use of an XML organization file though this is what we did, we created our own XML file and used this.
First export Acme Organization to an XML file and then change it to your needs...Be careful and use an XML editor to help get it right. You will see the structure, start small and build it up as you go along.
Or create a new Organization with one user, a couple of groups and couple of memberships and build from there.
It will take time. As I say BonitaSoft don't support any manipulation of the user XML file so be careful and you will get there.
regards
Hi Antoine, in order to check this code , i have created 2 pages , where the first page it contains a simple form like this :
username:
password:********
and when i press the send button , the user and password is processing in a second page .
this page it contains a part of API authentication , also contains a simple data user request ,and when i execute this code , it shows me the information about the user with id=205 , so for this reason I think that the login system is working good . I don't know where is saved the cookie file in order to verify that the login system is working good.
1)Firstly i want to create an user using PHP CURL, so i have created this code but it doesn't work, because acording the bonita example i have to recieve some response.
$data_array = array("userName" => "prova.prova", "password" => "prova", "password_confirm" => "prova", "firstname" => "prova", "lastname" => "prova");
$data_json = json_encode($data_array);
echo $data_json;
curl_setopt($conexio2, CURLOPT_URL,'http://localhost:8080/bonita/API/identity/user/');
curl_setopt($conexio2, CURLOPT_POST, 1);
curl_setopt($conexio2, CURLOPT_POSTFIELDS, $data_json);
curl_setopt($conexio2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($conexio2, CURLOPT_COOKIEJAR, 'cookie2.txt');
curl_setopt($conexio2, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($data_json)));
$result = curl_exec($conexio2);
//curl_close($conexio2);
2)Secondly , i want to recieve the information about the user that is logged in the sesion.
curl_setopt($ch, CURLOPT_URL, $baseURL.'/API/identity/user/205
where "205" is the user with id=205 but i need, something like this:
curl_setopt($ch, CURLOPT_URL, $baseURL.'/API/identity/user/."$username".
Thanks inadvanced
HI SeanMcp , i have done the second option , and my problem happens when i want to activate this organization, because i dont know how i do it.
Now i will say , what i want to do:
My final objctive is: to have a web pages where one of these it is the login system. I would like that this system login could verify the username and password in 2 databases, the first is in my personal database and the second is bonita database specifically int the _user table, for this reason i want to know , when bonita database is updated.
the second page that i want to do is named user_registration.php , in this i want to create an user regstration form, and as before i want to create an user in 2 databases , where one of this is my personal database and the other is bonita database .according to what you've told me, i can not use the mysql syntax for write directly in bonita database, also i want to know , how often is the data updated in the bonita database.
Thank in advanced
Hi Sean Mcp, can you explain me , what did you mean with these words: - First export Acme Organization to an XML file and then change it to your needs. - create a new Organization with one user, a couple of groups and couple of memberships and build from there. execuse me i'm new in BOS version 6.5.
Thanks in advanced
Comments
Apologies the two things are separate
DO First OR DO Second
Open Bonita Studio click Organization->Export Select the Organization, change the destination path if necessary Click Finish...
Rename the file to "yourOrganizationName.xml" And edit the file accordingly... change all acme to yourOrganizationName for example...
then import the file, publish it, and use it...
OR
Organization->Manage->Add
and create a new organization with one user etc. and edit as above...
regards
First of all I think it is important to understand that having user available in Bonita Engine database is mandatory.
So you will need to synchronize your users database with Bonita one. To perform the synchronization you will to create your own tool using Identity API. This API is available either using Java client library or REST .
For Community edition you will need to synchronize both username and password. That's because it is not possible in Community edition to reconfigure user authentication service. Such feature is only available in Subscription edition. Bonita BPM Subscription edition also provide a tool to synchronize users between LDAP/Active Directory and Bonita users database.
You need to make sure that all users that exist in your database also exist in Bonita user database (the user_ table).
As you develop using PHP I would recommend to use REST API (take a look at this documentation page that provide a "Create a new user" example). In order to make this call you first need to authenticate (take a look at this other documentation page )
Can you explain what does work in your code?
Did you manage to successfully go through the authentication phase? Did you get the cookie with the session id information?
Comments
Hi,
If you want I can give u a home made connector to create an user account and show you the next step to insert it in the SQL database (simple request). Ask me if you are interested.
Thanks for your response sylvain , i'm interested in this connector , can you give me it thanks.
Hi,
.bar: http://dl.free.fr/tRrBJa6rZ .proc: http://dl.free.fr/nJWHE5rNA
Ask if you want explanations.
Thanks sylvain , how i can use it?
Add me on Skype I can explain u tonight (sylv1.bailly)
ok sylvain, if it is possible ,i will try to talk with you in this night.