this is how you get a good grails starter application with social login up and running
now follow these steps to install spring-security-core
compile 'org.grails.plugins:spring-security-core:3.2.0' //(1)
<1> make sure that the version is the http://plugins.grails.org/plugin/grails/spring-security-core[current one].
follow the s2-quickstart instructions:
grails s2-quickstart security User Role --groupClassName=RoleGroup grails s2-create-persistent-token security.PersistentLogin grails s2-create-role-hierarchy-entry security.RoleHierarchyEntry
logger 'org.springframework.security', DEBUG, ['STDOUT'], false logger 'grails.plugin.springsecurity', DEBUG, ['STDOUT'], false
to get the app started, add the following lines to the ìnit`-closure in grails-app/init/../bootstrap.groovy
def adminRole = new Role(authority: 'ROLE_ADMIN').save() def testUser = new User(username: 'me', password: 'password').save() UserRole.create testUser, adminRole UserRole.withSession { it.flush() it.clear() } assert User.count() == 1 assert Role.count() == 1 assert UserRole.count() == 1
…and on top of the file, right after the package name:
import security.UserRole import security.Role import security.User