aspose file tools*
The moose likes Spring and the fly likes Custom Login Form in Spring Security Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Custom Login Form in Spring Security" Watch "Custom Login Form in Spring Security" New topic
Author

Custom Login Form in Spring Security

Soheil Tayari
Greenhorn

Joined: Apr 04, 2008
Posts: 29
I have a problem with Spring Security custom login form. I think I'm following the API example but the login just don't work. Here's my simple login page (I'm using Struts2):



And here is my application context:


Once I hit the submit the page just gets reloaded. I tried this even without Struts2 tags and with plain HTML. I don't know what I'm doing wrong here.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

It looks like you are securing your login page. So you have to be logged in to get to the login page.


<intercept-url pattern="/SpringLogin" requires-channel="https" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<form-login login-page="/SpringLogin"/> (It's a Struts2 action which brings up the login form above)

Basically the "IS_AUTHENTICATED_ANONYMOUSLY" means they have to be logged in.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Soheil Tayari
Greenhorn

Joined: Apr 04, 2008
Posts: 29
Mark Spritzler wrote:It looks like you are securing your login page. So you have to be logged in to get to the login page.


<intercept-url pattern="/SpringLogin" requires-channel="https" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
<form-login login-page="/SpringLogin"/> (It's a Struts2 action which brings up the login form above)

Basically the "IS_AUTHENTICATED_ANONYMOUSLY" means they have to be logged in.

Mark


Thank you Mark. You're right I set the filters to "none" and it worked. But How can I achieve the secure channel for that URL?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Won't just

<intercept-url pattern="/SpringLogin" requires-channel="https" filters="none/>

work?

Mark">
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Custom Login Form in Spring Security