You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Chris Joelly <ch...@unycom.com> on 2004/01/14 17:37:34 UTC

inserting user into mysql for use with turbine security

Hello!

i want to insert/update an user from within my application for use with
turbine security. i looked at the datamodel and have inserted the user
with the following statements into TURBINE_USER and TURBINE_USER_GROUP_ROLE


insert into TURBINE_USER (USER_ID, LOGIN_NAME, PASSWORD_VALUE, FIRST_NAME, LAST_NAME)
	values (1001, 'portal', 'portal', 'APortal', 'User');
	
insert into TURBINE_USER_GROUP_ROLE (USER_ID, GROUP_ID, ROLE_ID)
	values (1001, 1, 2);

are there any other tables to set? the group and role used in this
example does exist, but i can't login with this user ...

thx, Chris

-- 
mit freundlichen Grüßen / with kind regards
 
Ing. Christian Jölly @ Solutions
unycom  Information Technology Services GmbH
A-8042 Graz | Schmiedlstraße 1 / III

Tel: ++43 (0)316 / 818 828 - 30
Fax: ++43 (0)316 / 818 828 - 38
chris.joelly@unycom.com
http://www.unycom.com

Christel zu Oli (es ging um /etc/apt/sources.list):

"Unstable?!  Bist Du bescheuert?"

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: inserting user into mysql for use with turbine security

Posted by Chris Joelly <ch...@unycom.com>.
Hello!

thx to all answers. i'm always very excited about the helpfulness
found on this list. delightful :-)

thx, Chris

-- 
mit freundlichen Grüßen / with kind regards
 
Ing. Christian Jölly @ Solutions
unycom  Information Technology Services GmbH
A-8042 Graz | Schmiedlstraße 1 / III

Tel: ++43 (0)316 / 818 828 - 30
Fax: ++43 (0)316 / 818 828 - 38
chris.joelly@unycom.com
http://www.unycom.com

-!- Znarck [~scholzo@217.89.81.34] has joined #debian.de
<Znarck> hallo!
<Znarck> join #debian
<Znarck> ls
<Znarck> hello
<Znarck> quit
-!- Znarck [~scholzo@217.89.81.34] has quit [Client Quit]

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: inserting user into mysql for use with turbine security

Posted by Jeff Painter <pa...@kiasoft.com>.
On Wed, 14 Jan 2004, Matt Hughes wrote:

> 
> I found that I had to add new users to the turbine_root role (number 1) 
> before they could log in to the app. Not sure why this is.
> 
> insert into TURBINE_USER_GROUP_ROLE (USER_ID, GROUP_ID, ROLE_ID)
>   	values (1001, 1, 1);
> 
> 


your SecureScreen.java file is where the "turbine_root" role is specified. 
I usually end up making individual SecureScreen's within differing 
packages that require differing role access. If your user does not have 
the "turbine_root" role and your SecureScreen is still looking for it, 
then that is the answer to why your user cannot log in more than likely.

-- 
Regards,

Jeffery Painter

- --
painter@kiasoft.com                     http://kiasoft.com
PGP FP: 9CE8 83A2 33FA 32B1 0AB1  4E62 E4CB E4DA 5913 EFBC

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
 
iD8DBQE/qEQE5Mvk2lkT77wRAnMJAJ9vJ6qOkg/mvqqIpz7troCEQJ8bFACglu/U
YNXabx7DZOV2Hd9LwSTmGpY=
=dWiu
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: inserting user into mysql for use with turbine security

Posted by Matt Hughes <mh...@uvic.ca>.
Chris Joelly wrote:
> Hello!
> 
> i want to insert/update an user from within my application for use with
> turbine security. i looked at the datamodel and have inserted the user
> with the following statements into TURBINE_USER and TURBINE_USER_GROUP_ROLE
> 
> 
> insert into TURBINE_USER (USER_ID, LOGIN_NAME, PASSWORD_VALUE, FIRST_NAME, LAST_NAME)
> 	values (1001, 'portal', 'portal', 'APortal', 'User');
> 	
> insert into TURBINE_USER_GROUP_ROLE (USER_ID, GROUP_ID, ROLE_ID)
> 	values (1001, 1, 2);
> 
> are there any other tables to set? the group and role used in this
> example does exist, but i can't login with this user ...
> 
> thx, Chris
> 

I found that I had to add new users to the turbine_root role (number 1) 
before they could log in to the app. Not sure why this is.

insert into TURBINE_USER_GROUP_ROLE (USER_ID, GROUP_ID, ROLE_ID)
  	values (1001, 1, 1);

-- 
  Matt Hughes
   + mhughe@uvic.ca
   + http://spacemonkeys.ca/

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Turbine and Hibernate again

Posted by Gerry Duprey <gd...@Schools-OPEN.com>.
Howdy,

> In most of the applications that I have written with turbine, I have
> written my own security service. A look at the TemplateSessionValidator,
> TurbineAccessControlList, VelocitySecureScreen and VelocitySecureAction
> classes will start to point you in the right direction.

Does this mean you write classes implementing things like 
org.apache.turbine.om.security.User or are you just ignorning those classes 
and related services and rolling your own?

I'm really trying to get a feel for what happens if I were to not use any of 
the security stuff in Turbine.  It's not what I want to do, but I think by 
understanding how (im)possible that is, I'll get a better understanding for 
how security is integrated.

Thanks!

Gerry
-- 
Gerry Duprey
________________________________________
SchoolsOPEN, LLC
123 North Ashley, Suite 120
Ann Arbor, MI 48104
Phone (877) 483-1944 Ext. 401
Fax (734) 661-0819

Visit us Online at www.Schools-OPEN.com


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Turbine and Hibernate again

Posted by Gerry Duprey <gd...@Schools-OPEN.com>.
Howdy Again,

> There are a number of implementations of a security service in the
> jakarta-turbine-fulcrum packages. I'm not sure how good the
> documentation is but the code is there. 

I've found the one Eric posted there.  Can this be deployed without having to 
deploy all of Fulcrum with Turbine 2.3 or do I have to get/build/add al of 
Fulcrum in?

I'm not 100% clear about Fulcrums relation to Turbine 2.3 - there seems to be 
a lot of overlap and my impressions is Fulcrum is for Turbine 2.4 (making me 
think this code may not work with a 2.3 install).

Thanks again,

Gerry
-- 
Gerry Duprey
________________________________________
SchoolsOPEN, LLC
123 North Ashley, Suite 120
Ann Arbor, MI 48104
Phone (877) 483-1944 Ext. 401
Fax (734) 661-0819

Visit us Online at www.Schools-OPEN.com


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Turbine and Hibernate again

Posted by Peter Courcoux <pe...@courcoux.biz>.
On Wed, 2004-01-14 at 21:14, Gerry Duprey wrote:
> Howdy,
> 
> I was following the discussion last month about integrating Turbine and 
> Hibernate.  One of the last comments on the subject was a pointer to the 
> Hibernate HowTo in the Turbine How To pages.
> 
> I've looked it over and for the most part it's pretty simple/understandable. 
> However, I do not quite understand what the need for the hibernate-avalon jar 
> is.  What does that supply?  From the rest of the code examples and 
> discussion, it would appear that I could integrate hibernate (as done in these 
> examples) without it.

Turbine has always had a framework for providing a range of services to
web applications. The earlier services framework was based on
jakarta-turbine-stratum. More recently, a lot of work has been done on
service frameworks and one such project is apache Avalon. This framework
was chosen to replace the stratum framework in turbine. The
hibernate-avalon jar provides an api and implementation which makes
hibernate available as a service following the avalon framework
conventions. Hibernate could, of course, be integrated into turbine
without it but IMHO this would be a backward step. 

If you are interested in why, go to the avalon.apache.org pages and look
for information on 'Separation of Concerns' (SOC) and 'Inversion of
Control' (IOC).

> 
> Most critical to me though is replacing Turbines reliance on Torque for the 
> user security functions.  There was some discussion about having created a 
> replacement security system for Turbinbe/Hibernate, but I'm not sure what 
> steps to take to do this.  What code, what config items, etc, etc.
> 

There are a number of implementations of a security service in the
jakarta-turbine-fulcrum packages. I'm not sure how good the
documentation is but the code is there. 

> Finally, other than being redundant, is there anything we would loose, 
> functionality wise, in Turbine if we just didn't use any of the security stuff 
> and used our own method?  Ideally, I think reusing code would be best if we 
> can make it fit, but I'd like to explore the options available to us.
> 
I believe that the roadmap for turbine includes the breaking out of some
of the highly coupled code which still exists into individual components
which can lead to more flexibility in implementation. Following that,
there has been talk of implementing some sort of pipeline or filterchain
of components such as security, action loader, page loader etc. ,
allowing these to be switched in and out quickly and easily.

> Any help here would be appreciated - even if it's just pointers.  We've gotten 
> through the testing stage and are very happy with Turbine.  Now we need to 
> move on to real development and this is about all that is holding us up right now.
> 

In most of the applications that I have written with turbine, I have
written my own security service. A look at the TemplateSessionValidator,
TurbineAccessControlList, VelocitySecureScreen and VelocitySecureAction
classes will start to point you in the right direction.

> Thanks in advance,

> Gerry


I hope that this helps. 

Peter

> 
-- 
Peter Courcoux <pe...@courcoux.biz>

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Turbine and Hibernate again

Posted by Gerry Duprey <gd...@Schools-OPEN.com>.
Howdy,

I was following the discussion last month about integrating Turbine and 
Hibernate.  One of the last comments on the subject was a pointer to the 
Hibernate HowTo in the Turbine How To pages.

I've looked it over and for the most part it's pretty simple/understandable. 
However, I do not quite understand what the need for the hibernate-avalon jar 
is.  What does that supply?  From the rest of the code examples and 
discussion, it would appear that I could integrate hibernate (as done in these 
examples) without it.

Most critical to me though is replacing Turbines reliance on Torque for the 
user security functions.  There was some discussion about having created a 
replacement security system for Turbinbe/Hibernate, but I'm not sure what 
steps to take to do this.  What code, what config items, etc, etc.

Finally, other than being redundant, is there anything we would loose, 
functionality wise, in Turbine if we just didn't use any of the security stuff 
and used our own method?  Ideally, I think reusing code would be best if we 
can make it fit, but I'd like to explore the options available to us.

Any help here would be appreciated - even if it's just pointers.  We've gotten 
through the testing stage and are very happy with Turbine.  Now we need to 
move on to real development and this is about all that is holding us up right now.

Thanks in advance,

Gerry

-- 
Gerry Duprey
________________________________________
SchoolsOPEN, LLC
123 North Ashley, Suite 120
Ann Arbor, MI 48104
Phone (877) 483-1944 Ext. 401
Fax (734) 661-0819

Visit us Online at www.Schools-OPEN.com


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Antwort: inserting user into mysql for use with turbine security

Posted by US...@gea-wiegand.de.



Hello Chris

you should add users by using the methods exposed by the security
framework.

adding a user looks like (or something like that ...):

      user = (TorqueUser) TurbineSecurity.getUserInstance();
      user.setCreateDate(new Date());
      user.setName(p.getString("name"));
      user.setNew(true);
      TurbineSecurity.addUser(user,p.getString("password"));

there are also methods for adding groups or roles, and for adding users to
groups etc.
Have a look at the java docs of the security framework !

Hope that helps

/uwe



                                                                                                                                        
                      Chris Joelly                                                                                                      
                      <chris.joelly@uny        An:       turbine-user@jakarta.apache.org                                                
                      com.com>                 Kopie:                                                                                   
                                               Thema:    inserting user into mysql for use with turbine security                        
                      14.01.2004 17:37                                                                                                  
                      Bitte antworten                                                                                                   
                      an "Turbine Users                                                                                                 
                      List"                                                                                                             
                                                                                                                                        




Hello!

i want to insert/update an user from within my application for use with
turbine security. i looked at the datamodel and have inserted the user
with the following statements into TURBINE_USER and TURBINE_USER_GROUP_ROLE


insert into TURBINE_USER (USER_ID, LOGIN_NAME, PASSWORD_VALUE, FIRST_NAME,
LAST_NAME)
             values (1001, 'portal', 'portal', 'APortal', 'User');

insert into TURBINE_USER_GROUP_ROLE (USER_ID, GROUP_ID, ROLE_ID)
             values (1001, 1, 2);

are there any other tables to set? the group and role used in this
example does exist, but i can't login with this user ...

thx, Chris

--
mit freundlichen Grüßen / with kind regards

Ing. Christian Jölly @ Solutions
unycom  Information Technology Services GmbH
A-8042 Graz | Schmiedlstraße 1 / III

Tel: ++43 (0)316 / 818 828 - 30
Fax: ++43 (0)316 / 818 828 - 38
chris.joelly@unycom.com
http://www.unycom.com

Christel zu Oli (es ging um /etc/apt/sources.list):

"Unstable?!  Bist Du bescheuert?"

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: inserting user into mysql for use with turbine security

Posted by David Demner <tu...@demner.com>.
Hi,

Alternately, you can specify the users/roles/groups in your
turbine-security.xml conf file.  For example,

<TurbineUser UserId="1" LoginName="admin" PasswordValue="guessme"
FirstName="ad" LastName="min"/>
<TurbineGroup GroupId="1" GroupName="global"/>
<TurbinePermission PermissionId="1" PermissionName="user_admin"/>
<TurbineRole RoleId="1" RoleName="admin"/>
<TurbineRolePermission RoleId="1" PermissionId="1"/>
<TurbineUserGroupRole UserId="1" GroupId="1" RoleId="1"/>

Then, after a little monkeying around with the build.xml and
build-torque.xml files, you can import this into the database:

build.xml:

  <target
    name="security">
    <antcall target="schema-sql"/>
    <antcall target="security-sql"/>
    <ant
      antfile="${torque.buildFile}"
      target="insert-security-sql">
    </ant>
  </target>
  

build-torque.xml:

  <target
    name="insert-security-sql"
    description="==> inserts the generated sql ">

    <sql
      autocommit="true"
      driver="${torque.database.driver}"
      onerror="continue"
      password="${torque.database.password}"
      src="${torque.sql.dir}/turbine-schema.sql"
      url="${torque.database.buildUrl}"
      userid="${torque.database.user}">
      <classpath refid="torque-classpath"/>
    </sql>
    <sql
      autocommit="true"
      driver="${torque.database.driver}"
      onerror="continue"
      password="${torque.database.password}"
      src="${torque.sql.dir}/turbine-security.sql"
      url="${torque.database.buildUrl}"
      userid="${torque.database.user}">
      <classpath refid="torque-classpath"/>
    </sql>
  </target>

Then just run 'ant security' and it will refresh all your
users/groups/roles/etc.  But be careful since written like this, it will
blow away all the security that isn't in your xml file, so it probably most
useful in dev.  You can remove the first <sql> from the build-torque.xml
file and be prepared for a bunch of primary key errors if you just want to
add to your current users/groups/roles.

My reply turned out to be a lot longer than I expected.  And it doesn't
really answer your question since you wanted something you could run from
your application.  But the reply was so long, I didn't want to waste it so
I'm sending it anyway.

Good luck,

David

-----Original Message-----
From: Chris Joelly [mailto:chris.joelly@unycom.com] 
Sent: Wednesday, January 14, 2004 8:38 AM
To: turbine-user@jakarta.apache.org
Subject: inserting user into mysql for use with turbine security


Hello!

i want to insert/update an user from within my application for use with
turbine security. i looked at the datamodel and have inserted the user
with the following statements into TURBINE_USER and TURBINE_USER_GROUP_ROLE


insert into TURBINE_USER (USER_ID, LOGIN_NAME, PASSWORD_VALUE, FIRST_NAME,
LAST_NAME)
	values (1001, 'portal', 'portal', 'APortal', 'User');
	
insert into TURBINE_USER_GROUP_ROLE (USER_ID, GROUP_ID, ROLE_ID)
	values (1001, 1, 2);

are there any other tables to set? the group and role used in this
example does exist, but i can't login with this user ...

thx, Chris

-- 
mit freundlichen Grüßen / with kind regards
 
Ing. Christian Jölly @ Solutions
unycom  Information Technology Services GmbH
A-8042 Graz | Schmiedlstraße 1 / III

Tel: ++43 (0)316 / 818 828 - 30
Fax: ++43 (0)316 / 818 828 - 38
chris.joelly@unycom.com
http://www.unycom.com

Christel zu Oli (es ging um /etc/apt/sources.list):

"Unstable?!  Bist Du bescheuert?"

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org