
skeleton.grails-app.init.BootStrap.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-security-rest-testapp-profile Show documentation
Show all versions of spring-security-rest-testapp-profile Show documentation
Grails plugin to implement token-based, RESTful authentication using Spring Security
The newest version!
import org.springframework.security.core.authority.SimpleGrantedAuthority
import org.springframework.security.core.userdetails.User
import org.springframework.security.core.userdetails.UserDetails
import org.springframework.security.provisioning.InMemoryUserDetailsManager
class BootStrap {
InMemoryUserDetailsManager userDetailsService
def init = { servletContext ->
UserDetails jimi = new User('jimi', '{noop}jimispassword', [new SimpleGrantedAuthority('ROLE_USER'), new SimpleGrantedAuthority('ROLE_ADMIN')])
userDetailsService.createUser(jimi)
UserDetails alvaro = new User('115537660854424164575', '{noop}N/A', [new SimpleGrantedAuthority('ROLE_USER'), new SimpleGrantedAuthority('ROLE_ADMIN')])
userDetailsService.createUser(alvaro)
}
def destroy = {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy