grails - Spring Security is redirecting to localhost on production server -
i have grails application spring-security-core plugin installed. works fine locally. deployed staging server , worked fine. deployed our production server mirror of our staging server. can unprotected pages fine. when spring security kicks in , tries it's redirects redirecting localhost instead of grails.serverurl.
i'm going turn logging high possible , redeploy see if can make heads or tails of anything. i'll post finding here. if has experienced before , knows might happening, please let me know. also, if there configuration files need seen can provide well. thanks.
update added following bottom config.groovy
grails.plugins.springsecurity.usesecurityeventlistener = true grails.plugins.springsecurity.onauthorizationevent = { e, appctx -> println "here" println e }
locally, closure gets hit 2 times when try , access protected page. once initial url. second time auth url. deployed our production server , nothing.
the redirects done in org.springframework.security.web.authentication.loginurlauthenticationentrypoint.commence()
method, set breakpoint there if you're able borrow 1 of prod servers debugging.
it builds redirect url based on login form uri (e.g. /login/auth) uses request.getservername()
should same original request. note grails.serverurl
has no impact here since builds url using requested server name, port, context, etc.
it might affected putting apache or load balancer in front of servlet container, although i've done both , it's worked fine.
have done bean customization in resources.groovy
might affect this?
Comments
Post a Comment