0
votes

just followed this tutorial for custom login form, but when i submit its not authenticating but redirecting back to home.

here is the configuration

grails.plugin.springsecurity.auth.loginFormUrl = '/'
grails.plugins.springsecurity.successHandler.defaultTargetUrl = '/dashboard/'
grails.plugin.springsecurity.failureHandler.defaultFailureUrl = '/'

and post request going to http://localhost:8080/j_spring_security_check status code is 302 and in response header location is http://localhost:8080/

Moreover normal /login/auth with default ui is is working fine.

I am new to grails as well as to spring security. Am i missing something? :|

versions: spring 3.0.4 grails 3.1.4

Thanks

1

1 Answers

0
votes

Just read changes in v3 , was looking at older tutorial. To save someone's else time

/j_spring_security_check (the apf.filterProcessesUrl config setting) changed to /login/authenticate

/j_username (the apf.usernameParameter and switchUser.usernameParameter config settings) changed to username

/j_password (the apf.passwordParameter config setting) changed to password

/j_spring_security_logout (the logout.filterProcessesUrl config setting) changed to /logoff

In Spring Security 4 the value is actually /logout, but that conflicts with the standard LogoutController url, so the plugin uses /logoff instead

_spring_security_remember_me (the rememberMe.parameter config setting) changed to remember-me

/j_spring_security_switch_user (the switchUser.switchUserUrl config setting) changed to /login/impersonate

/j_spring_security_exit_user (the switchUser.exitUserUrl config setting) changed to /logout/impersonate