grails3-spring-security-demo icon indicating copy to clipboard operation
grails3-spring-security-demo copied to clipboard

Hi

Open arvind-das opened this issue 9 years ago • 5 comments

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 ?

arvind-das avatar Jul 03 '15 20:07 arvind-das

Did you ensure you did 'refresh-dependencies' after you added to the build configuration?

asoftwareguy avatar Jul 06 '15 14:07 asoftwareguy

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 avatar Oct 22 '15 11:10 gklinkmann

@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.

asoftwareguy avatar Oct 22 '15 12:10 asoftwareguy

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.

arvind-das avatar Oct 23 '15 08:10 arvind-das

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 .

gklinkmann avatar Oct 23 '15 10:10 gklinkmann