atom feed51 messages in org.codehaus.grails.userRe: [grails-user] JSecurity- Logging ...
FromSent OnAttachments
Daniel HonigDec 31, 2008 5:44 am 
Peter LedbrookDec 31, 2008 6:22 am 
Daniel HonigDec 31, 2008 6:32 am 
Daniel J. LaukJan 12, 2009 7:28 am 
Peter LedbrookJan 12, 2009 7:44 am 
Daniel J. LaukJan 12, 2009 7:55 am 
Les HazlewoodJan 12, 2009 8:03 am 
Daniel HonigJan 12, 2009 8:10 am 
Peter LedbrookJan 12, 2009 8:16 am 
Daniel J. LaukJan 12, 2009 9:34 am 
Les HazlewoodJan 12, 2009 10:19 am 
Daniel HonigJan 12, 2009 10:32 am 
Les HazlewoodJan 12, 2009 10:42 am 
Peter LedbrookJan 12, 2009 1:02 pm 
Daniel HonigJan 12, 2009 2:19 pm 
Robert McIntoshJan 12, 2009 2:23 pm 
Les HazlewoodJan 12, 2009 2:29 pm 
Robert McIntoshJan 12, 2009 2:35 pm 
Les HazlewoodJan 12, 2009 2:48 pm 
Les HazlewoodJan 12, 2009 2:49 pm 
Robert McIntoshJan 12, 2009 2:57 pm 
Peter LedbrookJan 12, 2009 10:58 pm 
CraigJan 13, 2009 7:45 am 
Peter LedbrookJan 13, 2009 7:48 am 
Daniel J. LaukJan 13, 2009 8:07 am 
Peter LedbrookJan 13, 2009 8:21 am 
CraigJan 13, 2009 8:22 am 
Daniel J. LaukJan 13, 2009 8:26 am 
Daniel HonigJan 13, 2009 5:24 pm 
Daniel J. LaukJan 14, 2009 4:18 am 
Daniel J. LaukJan 14, 2009 9:38 am 
Peter LedbrookJan 14, 2009 11:45 pm 
Daniel J. LaukJan 14, 2009 11:56 pm 
Peter LedbrookJan 15, 2009 6:07 am 
Les HazlewoodJan 15, 2009 6:13 am 
Daniel J. LaukJan 15, 2009 6:13 am 
Daniel J. LaukJan 15, 2009 6:17 am 
Peter LedbrookJan 15, 2009 6:27 am 
Les HazlewoodJan 15, 2009 6:28 am 
Daniel J. LaukJan 15, 2009 6:36 am 
tramuntanalJan 15, 2009 6:41 am 
Les HazlewoodJan 15, 2009 6:43 am 
tramuntanalJan 15, 2009 6:51 am 
Daniel J. LaukJan 15, 2009 8:50 am 
tramuntanalJan 15, 2009 9:28 am 
Les HazlewoodJan 15, 2009 9:33 am 
Daniel J. LaukJan 15, 2009 11:52 am 
Daniel J. LaukJan 15, 2009 12:05 pm 
Peter LedbrookJan 15, 2009 12:23 pm 
Daniel J. LaukJan 15, 2009 12:40 pm 
tramuntanalJan 16, 2009 12:59 am 
Subject:Re: [grails-user] JSecurity- Logging in a user without knowing the users password
From:Daniel J. Lauk (dani@gmail.com)
Date:Jan 13, 2009 8:07:23 am
List:org.codehaus.grails.user

I tried to implement all that today, but failed.

Here's what I did:

Step 1) I modified the approach documented, and used the decorator pattern instead of plain inheritance. Step 2) I extended DefaultWebSecurityManager with an override of the aforementioned createSubject(.....) method. Step 3) I added a bean definition to grails-app/conf/spring/resources.xml

The problem that I have left now, is that the correct SecurityManager is injected, but the Realms living in grails-app/realms/ are not picked up.

Any ideas?

Cheers, DJ

PS: I am happy to share my code, if you're interested.

2009/1/12 Daniel Honig <dani@gmail.com>:

Ok guys, I summarized the complete approach as I read through, and I think it is a simpler and possibly more elegant approach than the originally suggested solution. (Or at least easier to understand). So I have compiled the steps I'm taking below and will report back before long with a note on my progress, here are my notes which as of now encompass three steps: Directions for the assuming a delegate subject with Jsecurity: 1.Create a class that assumes a delegate subject that is already set in the session. (The assumed identity would be set in a controller) class AssumingDelegatingSubject extends DelegatingSubject { public Object getPrincipal() { return this.session?.assumedIdentity ?: super.getPrincipal() } }

2. Create a subclass of DefaultSecurityManager that returns the custom subject. Per, the previous note, from Les Hazlewood. The SecurityManager implementation would need to be subclassed to return instances of your custom DelegatingSubject subclass. You do that by overridding this overloaded method: http://www.jsecurity.org/api/org/jsecurity/mgt/DefaultSecurityManager.html#createSubject(org.jsecurity.subject.PrincipalCollection,%20org.jsecurity.session.Session,%20boolean,%20java.net.InetAddress) Your overridden method would return an instance of your custom DelegatingSubject subclass. "

3. Register the custom security manager in resources.groovy or resources.xml as jsecSecurityManager On Mon, Jan 12, 2009 at 4:03 PM, Peter Ledbrook <pet@cacoethes.co.uk> wrote:

But there might be changes in the underlying SecurityManager *implementation* that would be backwards-incompatible. But this would only affect you if you manually override any of those implementation methods. I'm not sure if the Grails plugin uses with any of these methods or not or does custom implementation or wrapping of them.

The plugin uses the bog-standard JSecurity security manager for web apps - DefaultWebSecurityManager. It allows the user to easily configure the session mode and authentication strategy, but that's it.

Cheers,