grails3-spring-security-demo
grails3-spring-security-demo copied to clipboard
Hi
Hi, I was following your code to implement spring security.Currently in a very odd situation, spring-boot-starter-security is not getting installed and I can not see in my external libs, not sure what is the issue. Though it is not related to this project but in a problem, any gusses what could be a problem ?
Did you ensure you did 'refresh-dependencies' after you added to the build configuration?
Hi, why you don't use Spring Security Core Plugin version 3.0.0.M1? https://grails-plugins.github.io/grails-spring-security-core/
@gklinkmann I created the demo prior to the Spring Security Core Plugin being ported to Grails 3.x. I should probably update the demo to use it, but it also showcases that you can just use Spring directly without any need for a plugin. The plugin simplifies the configuration and usage, and aligns with what was being done in Grails 2.x, but it not required in order to use Spring Security.
Actually that is soemthing that needs to be fixed @asoftwareguy . I have multiple projects and dependencies resolved from one project are not reflecting in other ones for some case. I cleared cache and .gradle. Ran it again and it worked.
thanks. I found another project ( https://github.com/rmondejar/grails3-library-example) , that implemented these plugin.
The main steps are:
-
build.gradle
compile 'org.grails.plugins:spring-security-core:3.0.0.M1'
-
add domains, controller and views for auth, user and login
-
conf/application.yml
grails:
plugin:
springsecurity:
userLookup:
userDomainClassName: 'auth.User'
authorityJoinClassName: 'auth.UserRole'
authority:
className: 'auth.Role'
controllerAnnotations:
staticRules:
'/error': ['permitAll']
'/assets/**': ['permitAll']
'/**/js/**': ['permitAll']
'/**/css/**': ['permitAll']
'/**/images/**': ['permitAll']
'/**/favicon.ico': ['permitAll']
'/auth/**': ['permitAll']
'/user/**': ["hasAnyRole('ROLE_ADMIN')"]
'/**': ["hasAnyRole('ROLE_USER, ROLE_ADMIN')"]
- bootstrapping user and roles
2015-10-22 14:37 GMT+02:00 Eric Kelm [email protected]:
@gklinkmann https://github.com/gklinkmann I created the demo prior to the Spring Security Core Plugin being ported to Grails 3.x. I should probably update the demo to use it, but it also showcases that you can just use Spring directly without any need for a plugin. The plugin simplifies the configuration and usage, and aligns with what was being done in Grails 2.x, but it not required in order to use Spring Security.
— Reply to this email directly or view it on GitHub https://github.com/asoftwareguy/grails3-spring-security-demo/issues/5#issuecomment-150207552 .