Plugins You can find out about all the publicly available Grails plugins.

Force SSL Plugin

  • Tags: ssl, security
  • Latest: 1.0.4
  • Last Updated: 25 April 2016
  • Grails version: 2.0 > *
1 vote
compile "org.grails.plugins:force-ssl:1.0.4"

 Documentation  Source  Issues


Creates a simple annotation to mark controller/actions as SSL restricted and performs the appropriate redirect.


plugins {
  compile ':force-ssl:1.0.0'


The Grails Force SSL Plugin provides an annotation for controllers to force ssl url endpoints. For example, you may want to restrict a shopping cart page or login page to SSL.


By default, the SSL plugin is enabled for all environments, with the exception of Development. This can be overridden by adjusting your Config.groovy

grails.plugin.forceSSL.enabled = false

The enabled flag can also be defined as a closure which will get passed the request attribute. This allows for evaluation on a per requeset level as to wether or not SSL should be enforced. Can be rather useful for disabling forced SSL for certain URL endpoints (for example server endpoints not behind a load balancer).

grails.plugin.forceSSL.enabled = { request ->
  if(request.serverName == '') {
    return false
  return true


Simply import the @SSLRequired annotation and apply at the controller level or at the annotation level.

import com.bertramlabs.plugins.SSLRequired

@SSLRequired //Will encrypt entire controller class SessionController { @SSLRequired //Or here for action level def signin() { //Signin Code Here } }

NOTE: Now the force-ssl plugin retains the values in your flashScope through the ssl redirect.