Annyce Davis

Davis Technology Consulting

  • Home
  • About Me
  • Blog
  • Courses
  • Newsletter

Spring Security vs. Apache Shiro

March 21, 2010 by Annyce Davis

This is a high level comparison of Spring Security and Apache Shiro, two Security frameworks that have plugins available in Grails.

Spring Security (a.k.a. ACEGI)

  • has users with roles
  • to restrict users on a more fine grained level, use interceptors in your controller
  • LDAP support
  • integration with CAS single-sign-on
  • has a new ACL option for the Grails Plugin
  • somewhat ‘heavy-handed’

Example (Using Grails Interceptor):
def beforeInterceptor = [action:checkViewableSites, except: “list”]

def checkViewableSites = {
if(!user.viewableSites.contains(Site.get(params.id) )) {
response.sendError 403
return false
}
}

Apache Shiro (a.k.a. JSecurity)

  • has support for permissions out of the box
  • LDAP support with Shiro plugin
  • easy to customize
  • Grails Nimble plugin that allows permissions on three levels: users, groups, and roles
  • Nimble plugin has an easy to use UI component for adding/modifying users and permissions
  • Nimble plugin has support for authentication through Facebook and OpenID out of the box

Example (Using Shiro Permissions):

  • profile:edit:1 – this means a person can edit only the Profile object with id 1
  • profile:*:* – this means that a person can do anything to any Profile object

Share this:

  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Reddit (Opens in new window) Reddit

Related

Filed Under: Grails Tagged With: Spring Security

Follow Me

  • Bluesky

Categories

  • Android (61)
  • Career (5)
  • Communication (4)
  • Flutter (1)
  • Git (4)
  • Gradle (4)
  • Grails (23)
  • iOS (1)
  • Java (8)
  • JavaScript (6)
  • Kotlin (17)
  • Life (5)
  • Public Speaking (26)
  • Revenue (2)
  • RxJava (1)
  • Software Development (14)
  • Twitter (3)
  • Uncategorized (11)
  • Video Course (5)

Follow Me

  • Bluesky

Copyright © 2025 · All Rights Reserved · Log in