- grails create-app basicauthdemo
- cd basicauthdemo
- grails install-plugin spring-security-core
- grails s2-quickstart basicauthdemo User Role
- Edit grails-app/conf/Config.groovy and add two lines telling the Spring Security plugin to use HTTP basic authentication:
grails.plugins.springsecurity.useBasicAuth = true grails.plugins.springsecurity.basic.realmName = "HTTP Basic Auth Demo"
- Edit grails-app/conf/BootStrap.groovy to setup a user and role:
import basicauthdemo.* class BootStrap { def init = { servletContext -> def userRole = Role.findByAuthority("ROLE_USER") ?: new Role(authority: "ROLE_USER").save(flush: true) def user = User.findByUsername("tst") ?: new User(username: "tst", password: "foo", enabled: true).save(flush: true) UserRole.create(user, userRole, true) } def destroy = { } }
- grails create-controller hello
- Edit grails-app/controllers/basicauthdemo/HelloController.groovy and add a security annotation:
package basicauthdemo import grails.plugins.springsecurity.Secured class HelloController { @Secured(['ROLE_USER']) def index() { render "Hello World!" } }
- grails run-app
- Open http://localhost:8080/basicauthdemo/hello
Monday, December 31, 2012
HTTP basic authentication in Grails with Spring Security
Setting up HTTP basic authentication in Grails using Spring Security is pretty straightforward. Here's a quick how-to:
Monday, December 17, 2012
Watching digital HD TV without a Telenet decoder
And now for something completely different. If you live in Flanders and use Telenet as cable TV provider, it might be interesting to know that you can watch quite a few digital HD channels without using a Telenet decoder (either an HD Digibox or HD Digicorder; Telenet also has a FAQ article documenting this). All you need is:
- A Telenet cable TV subscription
- A television set with DVB-C tuner
- één HD
- Canvas HD
- Ketnet/OP12
- France 3
- Arte Belgique
- TV5 Monde
- Actua TV
- CNBC Europe
- BBC World
- CNN
Subscribe to:
Posts (Atom)