grails-plugins / grails-spring-security-shiro

Apache License 2.0
13 stars 16 forks source link

Plugin needs org.springframework.security.core.userdetails.User but org.springframework.security.core.userdetails.UserDetails would be sufficient #1

Closed lukasjelonek closed 8 years ago

lukasjelonek commented 10 years ago

Hey,

I wanted to use your plugin to add shiro permission checking to my application that uses spring security. Unfortunately I don't retrieve the User information via the default spring security core GORM mechanisms, but via a custom AuthenticationProvider. This provider does not use the preimplemented User class from Spring but implements its own UserDetails class. On the spring security core side this works pretty well. But when adding your plugin I had a problem, as, in the SpringSecurityRealm, you cast the principal of the authentication to User, but UserDetails would be better as it is an interface implemented by User and seems to be sufficient for the stuff you do afterwards.

I changed the appropriate plugin code, but was not able to compile the plugin successfully as I currently have not enough knowledge of the grails plugin development (and not enough time to fix this) and how to use own plugins.

A workaround for my personal code is to extend the User class, but I hope that this won't be needed anymore in the long term.

I'll send you a pull request with the changes.

Greetings, Lukas

burtbeckwith commented 8 years ago

PR applied, will be in 1.0-RC2