java - Spring Security - Dispatch to /j_spring_security_check -


i have spring security in place , login via login.jsp works fine.

now, have automatically user logged in based on url (similar single sign on). have path parameter in url encrypted code, process code auto login.

i modifying logincontroller check if have valid path param using username & password, using username & password doing "forward:/j_spring_security_check?j_username="+username+"&j_password="+password

this directs me login.jsp following error your login attempt not successful, try again. caused : authentication method not supported: get

i have tried "redirect:/j_spring_security_check?j_username="+username+"&j_password="+password no help.

call /j_spring_security_check post forward: & redirect: doing get, how can dispatch /j_spring_security_check post logincontroller?

thanks

/j_spring_security_check url mapped usernamepasswordauthenticationfilter serve requests.

in usernamepasswordauthenticationfilter, default, postonly set true.

the following change in spring-security.xml sets postonly false worked.

<bean id="authenticationfilter"        class="org.springframework.security.web.authentication.usernamepasswordauthenticationfilter"       p:postonly="false" /> 

also, in web.xml, following configuration required:

<filter-mapping> <filter-name>springsecurityfilterchain</filter-name>     <url-pattern>/*</url-pattern>     <dispatcher>request</dispatcher>     <dispatcher>forward</dispatcher> </filter-mapping> 

Comments