Home Spring Security's switch_user feature not working on production environment
Reply: 0

Spring Security's switch_user feature not working on production environment

user2037 Published in April 19, 2018, 10:02 am

We have a Grails application in which Spring Security's switch_user feature is working only on our dev and staging environment, but not in production.

Whenever we try to use switch_user on our production environment, it just redirects us to the same page we were before. No errors logged nor on the JavaScript console nor on Grails' stacktrace.


  • dev environment (http://localhost:8080) -> Everything fine
  • staging environment (https://app-staging.domain.com) -> Everything fine
  • production environment (https://app.domain.com) -> Can't switch_user

Current versions for all environments:

  • Grails: 2.2.1
  • Spring Security Core:

All Spring Security's plugin configurations are the same for all environments, there are no specifics for each one.

Cookies created by Spring Security are present on both staging and production environment.

Staging and production environments are both running on AWS ElasticBeanstalk, each one with separate VPCs, subnets, security groups and databases. We have gone through each AWS resource looking for differences, but we have found none so far.

We also looked for differences at the database table structure of both staging and production environment. None found.

DNS routing to AWS environment URLs is done equally for both staging and production.

There's something that we don't really understand yet. If we create another production environment- with same AWS configurations as the original- and point it to a different sub-domain, e.g. https://app-temp.domain.com, then switch_user works, just for a while. That is, we can use the feature, but after some time it stops working again.

We don't know where else to look. Any hints on what the issue could be?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.291444 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO