5 Replies Latest reply on Aug 18, 2008 10:57 AM by petia

    add new user

    jalamos

      Hello, I tried to add a new user through database or web-console, but when I login I can't.

      Error Login failed. Invalid user name or password.



      Help. :-)

        • 1. Re: add new user
          fornachari

          Same thing happens with me.
          Any idea?

          • 2. Re: add new user
            shansari

            Once you configured to the DB, need to create users and related stuff.

            For details refer JBPM user guide section 8.1.5

            :Ansari S.H

            • 3. Re: add new user
              petia

              Hi,

              I have the same problem. I can not create users through the web console. They do appear in the database, but they can not log in to the system.

              I am working with the 3.2.3 release and Java 1.6 (btw, the websale example coming with the 3.2.3 release did not work with Java 1.5 - as already mentioned on this forum.)

              Then, I started to follow the instructions in section 8, but when executing the script (from ...\jbpm-jpdl-suite-3.2.3\db\jbpm.jpdl.postgresql.sql) for creating the tables in PostgreSQL, I get the following error message

              12:41:42 [CREATE - 0 row(s), 0.000 secs] [Error Code: 0, SQL State: 42601] ERROR: syntax error at or near "create"
              ... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors]


              (I erased all alter statements in the beginning of the script, to mimic the description in section 8.1.3.1).

              Any advice (on how to define users) is appreciated. I browsed through the forum issues, but I may have missed something.

              Kind regards, Petia

              • 4. Re: add new user
                mputz

                Petia,

                the SQL 42601 error comes up because the SQL statements are missing the trailing semicolons (;).

                $ sed 's/$/;/g' jbpm.jpdl.postgresql.sql > jbpm.jpdl.postgresql.delimiter.sql
                $ psql -d <database> -U <dbuser> -W -f jbpm.jpdl.postgresql.delimiter.sql
                


                Also, you'd need not only JBPM_ID_USER entries as outlined in the SQL snippet of Chapter 8.5.1 of the docs, but also entries in the JBPM_ID_GROUP and JBPM_ID_MEMBERSHIP table:

                INSERT INTO JBPM_ID_GROUP VALUES(1,'G','sales','organisation',NULL);
                INSERT INTO JBPM_ID_GROUP VALUES(2,'G','admin','security-role',NULL);
                INSERT INTO JBPM_ID_GROUP VALUES(3,'G','hr','organisation',NULL);
                INSERT INTO JBPM_ID_GROUP VALUES(4,'G','user','security-role',NULL);
                INSERT INTO JBPM_ID_GROUP VALUES(5,'G','manager','security-role',NULL);
                INSERT INTO JBPM_ID_USER VALUES(1,'U','user','user@sample.domain','user');
                INSERT INTO JBPM_ID_USER VALUES(2,'U','manager','manager@sample.domain','manager');
                INSERT INTO JBPM_ID_USER VALUES(3,'U','admin','admin@sample.domain','admin');
                INSERT INTO JBPM_ID_USER VALUES(4,'U','shipper','shipper@sample.domain','shipper');
                INSERT INTO JBPM_ID_MEMBERSHIP VALUES(1,'M',NULL,NULL,2,4);
                INSERT INTO JBPM_ID_MEMBERSHIP VALUES(2,'M',NULL,NULL,3,4);
                INSERT INTO JBPM_ID_MEMBERSHIP VALUES(3,'M',NULL,NULL,1,4);
                INSERT INTO JBPM_ID_MEMBERSHIP VALUES(4,'M',NULL,NULL,4,4);
                INSERT INTO JBPM_ID_MEMBERSHIP VALUES(5,'M',NULL,NULL,4,3);
                INSERT INTO JBPM_ID_MEMBERSHIP VALUES(6,'M',NULL,NULL,2,3);
                INSERT INTO JBPM_ID_MEMBERSHIP VALUES(7,'M',NULL,NULL,3,3);
                INSERT INTO JBPM_ID_MEMBERSHIP VALUES(8,'M',NULL,NULL,3,2);
                INSERT INTO JBPM_ID_MEMBERSHIP VALUES(9,'M',NULL,NULL,2,2);
                INSERT INTO JBPM_ID_MEMBERSHIP VALUES(10,'M',NULL,NULL,2,5);
                INSERT INTO JBPM_ID_MEMBERSHIP VALUES(11,'M',NULL,'boss',2,1);
                INSERT INTO JBPM_ID_MEMBERSHIP VALUES(12,'M',NULL,NULL,1,1);
                


                Finally, if you add a new user using the jbpm-console, you will also need to associate the new user entry with a group, eg. by default at least the 'user' group to be able to login.


                • 5. Re: add new user
                  petia

                  Thanks Martin

                  Your comment was very helpful. In the web-console, I had indeed assigned a group (which I had defined) to my user, but I realise now that I also have to have the group "user" assigned to him as well. (I must have missed this detail in the documentation).

                  When playing around with the predefined groups I tried to assign the group "admin" (without assigning the group "user") to my user. This causes the following error message

                  HTTP Status 403 - Access to the requested resource has been denied

                  after which I need to restart the system.

                  If the group "user" is assigned to a user, everything works nicely.

                  Greetings, Petia