• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Custom Login Form in Spring Security

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Soheil Tayari
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Won't just

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

work?

Mark">
 
reply
    Bookmark Topic Watch Topic
  • New Topic