RE: Automatic creation of users??

rohitajm <[email protected]>
Newsgroups gmane.comp.jakarta.slide.user
Message-ID <[email protected]>
Thanks for reply.

I have seen the links suggested by you, but in my case there is no change in
'users' table in 'authority' database. 'users' is the table where I am
storing 'user_name' and 'user_pass'. 

I am using 'mm.mysql-2.0.4-bin.jar' driver in '%TomcatHome%\Server\Lib'
folder

However through this I am able to authenticate Slide. I am mentioning the
contents of my 'domain.xml' file below. Whether it require any correction.
Or I should do other entries also. 

Other than this I have done following entry in 'Server.xml' also to
implement JDBCRealm.
-------------------------
[server.xml]
-------------------------
  <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99" 
    driverName="org.gjt.mm.mysql.Driver" 
    connectionURL="jdbc:mysql://localhost/authority?user=root;password=root" 
    userTable="users" userNameCol="user_name" userCredCol="user_pass" 
    userRoleTable="user_roles" roleNameCol="role_name" /> 
-------------------------
-------------------------
[domain.xml]
-------------------------
...
...
- <configuration>
- <!--  Paths configuration 
  --> 
  <userspath>/users</userspath> 
- <!--  Roles definition 
  --> 
  <role name="root">slideroles.basic.RootRole</role> 
  <role name="user">slideroles.basic.UserRole</role> 
  <role name="guest">slideroles.basic.GuestRole</role> 
- <!--  Users management 
  --> 
  <auto-create-users>true</auto-create-users> 
- <!-- <auto-create-users>root</auto-create-users> 

  --> 
- <!-- <auto-create-users-role>user</auto-create-users-role>
<auto-create-users-role>slideroles.basic.UserRole</auto-create-users-role> 
<auto-create-users-role>org.apache.slide.structure.SubjectNode</auto-create-users-role>

  --> 
 
<auto-create-users-role>slideroles.basic.RootRoleImpl</auto-create-users-role> 
- <!--  Actions mapping 
  --> 
  <read-object>/actions/read</read-object> 
  <create-object>/actions/write</create-object> 
  <remove-object>/actions/write</remove-object> 
  <grant-permission>/actions/write-acl</grant-permission> 
  <revoke-permission>/actions/write-acl</revoke-permission> 
  <read-permissions>/actions/read-acl</read-permissions> 
 
<read-own-permissions>/actions/read-current-user-privilege-set</read-own-permissions> 
  <lock-object>/actions/write</lock-object> 
  <kill-lock>/actions/unlock</kill-lock> 
  <read-locks>/actions/read</read-locks> 
  <read-revision-metadata>/actions/read</read-revision-metadata> 
 
<create-revision-metadata>/actions/write-properties</create-revision-metadata> 
 
<modify-revision-metadata>/actions/write-properties</modify-revision-metadata> 
 
<remove-revision-metadata>/actions/write-properties</remove-revision-metadata> 
  <read-revision-content>/actions/read</read-revision-content> 
  <create-revision-content>/actions/write-content</create-revision-content> 
  <modify-revision-content>/actions/write-content</modify-revision-content> 
  <remove-revision-content>/actions/write-content</remove-revision-content> 
  <bind-member>/actions/bind</bind-member> 
  <unbind-member>/actions/unbind</unbind-member> 
- <!--  Paths configuration 
  --> 
  <userspath>/users</userspath> 
  <rolespath>/roles</rolespath> 
  <actionspath>/actions</actionspath> 
  <filespath>/files</filespath> 
  <auto-create-users>true</auto-create-users> 
  <parameter name="dav">true</parameter> 
  <parameter name="standalone">true</parameter> 
  <parameter name="acl_inheritance_type">path</parameter> 
- <!--  Nested roles: 0 means no nesting (default), 1 means one sublevel,
etc. 
  --> 
  <parameter name="nested_roles_maxdepth">0</parameter> 
- <!--  Can be "off", "write" and "full" 
  --> 
  <parameter name="sequential-mode">full</parameter> 
- <!--  "false" lets all read-only methods be executed outside of
transactions 
  --> 
  <parameter name="all-methods-in-transactions">true</parameter> 
- <!--  Setting this to true will force Slide to internally convert the
username a user
                 enters at login to lowercase. This is useful for users who
can't be bothered
                 with turning off their capslock key before logging in. 
  --> 
  <parameter name="force-lowercase-login">false</parameter> 
  </configuration>
- <data>
- <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/">
- <!--  Subject can be:
                any user             "all"
                authenticated user   "authenticated"
                unauthenticated user "unauthenticated"
                self                 "self"
                owner of resource    "owner"
                a user               "/users/john"
                a role               "/roles/admin"
                
  --> 
  <permission action="all" subject="/roles/root" inheritable="true" /> 
  <permission action="/actions/read-acl" subject="all" inheritable="true"
negative="true" /> 
  <permission action="/actions/write-acl" subject="all" inheritable="true"
negative="true" /> 
  <permission action="/actions/unlock" subject="all" inheritable="true"
negative="true" /> 
  <permission action="/actions/read" subject="all" inheritable="true" /> 
- <!--  /users 
  --> 
...
...
-------------------------

Regards

-Rohit



Darren Hartford wrote:
> 
> If you search the mailing list there is a number of posts related to
> this.
> 
> http://www.nabble.com/forum/Search.jtp?forum=336&local=y&query=auto+crea
> te+user
> 
> Similar results when you search the Wiki
> http://wiki.apache.org/jakarta-slide/AutoCreateUser
> 
> -D
> 
>> -----Original Message-----
>> From: rohitajm [mailto:[email protected]] 
>> Sent: Wednesday, August 16, 2006 3:30 AM
>> To: [email protected]
>> Subject: Automatic creation of users??
>> 
>> 
>> Hello All,
>> 
>> I am using JDBCRealm for authentication of user in Slide. For 
>> this I am using MySQL. I have created table 'users', which 
>> store usernames and their passwords. From this I am able to 
>> login as 'root' or 'john' or any other user which already 
>> exists in Slide.
>> 
>> What I want is: Whenever I create a user in Slide it should 
>> automatically be created in MySQL database. Please suggest 
>> what changes I should do in 'server.xml' or 'domain.xml' or 
>> in some other file.
>> 
>> Please help.
>> 
>> -rohit
>>
> ---------------------------------------------------------------------
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Automatic-creation-of-users---tf2113715.html#a5846906
Sent from the Jakarta Slide - User forum at Nabble.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.