Spring Security覆盖了Staging& amp;中的自定义登录页面生产环境

时间:2017-02-26 00:24:13

标签: spring grails login spring-security

我们创建了自定义登录页面,该页面需要的信息不仅仅是用户名&密码使用class HomeTableViewCell: UITableViewCell { override func awakeFromNib() { super.awakeFromNib() // Initialization code let gl = CAGradientLayer() gl.frame = self.bounds //gl.colors = [UIColor.red.cgColor as CGColor, UIColor.red.cgColor as CGColor] gl.backgroundColor = UIColor.blue.cgColor self.layer.addSublayer(gl) } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } } & spring-security-core:3.0.4个插件。它在spring-security-ui:3.0.0.M2环境中完美运行。

但是,它不适用于DEVELOPMENTSTAGING环境。不知何故,Spring Security的默认登录页面覆盖了我们的自定义页面(不确定这是怎么发生的!)。

我们的 urlMappings.groovy

PRODUCTION

application.groovy 文件中,我们有...

"/login" (controller: 'login', action: 'auth')

仅处理环境设置部分中的数据库内容...

grails.plugin.springsecurity.adh.errorPage = null
grails.plugin.springsecurity.successHandler.alwaysUseDefault = true
grails.plugin.springsecurity.successHandler.defaultTargetUrl = '/postLoginIndex'
grails.plugin.springsecurity.logout.afterLogoutUrl = '/'
grails.plugin.springsecurity.logout.postOnly = false

grails.plugin.springsecurity.controllerAnnotations.staticRules = [
  [pattern: '/**/register/**',    access:['permitAll']],
  [pattern: '/**/login/**',    access:['permitAll']]  //we know it's not required, but just trying to see if this helps
]

所以如何&为什么我们的自定义登录页面被environments { development { dataSource { dbCreate = "create-drop" url = "jdbc:postgresql://localhost:8888/postgres" username = "username" password = "password" } } staging { dataSource { dbCreate = "update" url = System.getenv("DB_URL") username = System.getenv("DB_USER") password = System.getenv("DB_PASS") } } production { dataSource { dbCreate = "update" url = System.getenv("DB_URL") username = System.getenv("DB_USER") password = System.getenv("DB_PASS") } } } &中的Spring Security默认页面取代。 STAGING环境让我们非常困惑。谁能帮助我们?谢谢!!!

0 个答案:

没有答案