You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by bu...@apache.org on 2014/04/04 10:47:30 UTC

svn commit: r904876 - in /websites/staging/isis/trunk: cgi-bin/ content/ content/components/security/shiro/configuring-shiro.html

Author: buildbot
Date: Fri Apr  4 08:47:30 2014
New Revision: 904876

Log:
Staging update by buildbot for isis

Modified:
    websites/staging/isis/trunk/cgi-bin/   (props changed)
    websites/staging/isis/trunk/content/   (props changed)
    websites/staging/isis/trunk/content/components/security/shiro/configuring-shiro.html

Propchange: websites/staging/isis/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Apr  4 08:47:30 2014
@@ -1 +1 @@
-1583812
+1584563

Propchange: websites/staging/isis/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Apr  4 08:47:30 2014
@@ -1 +1 @@
-1583812
+1584563

Modified: websites/staging/isis/trunk/content/components/security/shiro/configuring-shiro.html
==============================================================================
--- websites/staging/isis/trunk/content/components/security/shiro/configuring-shiro.html (original)
+++ websites/staging/isis/trunk/content/components/security/shiro/configuring-shiro.html Fri Apr  4 08:47:30 2014
@@ -456,6 +456,31 @@ for (RoleMemento role : roles) {
 
 <p>then this corresponds to the roles <em>realm1:user_role</em>, <em>realm1:self-install_role</em> and <em>realm1:analysis_role</em>.  If using the Wicket viewer, then there will also be another role which is used internally (namely <em>org.apache.isis.viewer.wicket.roles.USER</em>).</p>
 
+<h2>Configuring Shiro for JDBC</h2>
+
+<p>Something like the following should do:</p>
+
+<pre><code>builtInCacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
+securityManager.cacheManager = $builtInCacheManager
+
+ps = org.apache.shiro.authc.credential.DefaultPasswordService
+pm = org.apache.shiro.authc.credential.PasswordMatcher
+pm.passwordService = $ps
+
+aa = org.apache.shiro.authc.credential.AllowAllCredentialsMatcher
+sm = org.apache.shiro.authc.credential.SimpleCredentialsMatcher
+
+jdbcRealm=org.apache.shiro.realm.jdbc.JdbcRealm
+jdbcRealm.authenticationQuery = SELECT password from users where username = ?
+jdbcRealm.userRolesQuery = select r.label from users_roles ur inner join roles r on ur.role_id = r.id where user_id = (select id from users where username = ?);
+jdbcRealm.permissionsQuery=select p.permission from roles_permissions rp inner join permissions p on rp.permission_id = p.id where rp.role_id = (select id from roles where label = ?);
+jdbcRealm.permissionsLookupEnabled=true
+
+ds = com.mysql.jdbc.jdbc2.optional.MysqlDataSource
+ds ...etc
+securityManager.realms = $jdbcRealm
+</code></pre>
+
 
 
       </div>