how to force https
Asked Answered
E

1

6

I have a grails project. Right now, the user can access it either with HTTP or HTTPS. I would like to require that they can only access it through HTTPS. any ideas? I do have spring security core installed, if that can be of help

thanks jason

Estas answered 23/9, 2011 at 21:3 Comment(0)
L
7

Spring's core supports that:

grails.plugins.springsecurity.secureChannel.definition = [
  '/path/**':         'REQUIRES_SECURE_CHANNEL'
]
Leilanileininger answered 23/9, 2011 at 21:6 Comment(8)
Check out Chapter 17 at burtbeckwith.github.com/grails-spring-security-core/docs/manualLeilanileininger
Thanks for the response what file does this go into? UrlMappings.groovy?Estas
grails-app/conf/Config.groovy is where app-specific configurations go.Leilanileininger
thanks again. follow up question. if i want to make all pages require https, is this possible? or do i need to list every controller?Estas
Just remove the /path part, making it '/**'.Leilanileininger
Thanks! I have one more question but will post in a new threadEstas
@ChrisCashwell I tried adding this line, but now I get an error "This webpage has a redirect loop ERR_TOO_MANY_REDIRECTS". Any ideas?Hospitality
@dead_jake, How did you fix ERR_TOO_MANY_REDIRECTS?Calendar

© 2022 - 2024 — McMap. All rights reserved.