• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Redirecting unauthorised users decleartively

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have restricted the access to my application using <security-constraint> , but have a requirement that unauthorised users should be redirected to login page .
Is there any way I can achieve this using any feature provided by the container ?
I can write a filter to achieve this , but looking for any container provided feature to do this .

Thanks and Regards,
Chiku
 
Master Rancher
Posts: 43045
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If a non-authorized user accesses a protected area of the web app, then the container should redirect her to the login page automatically; are you saying that's not currently happening?
 
chiku awasthi
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes , that's not happening in my appliaction . I am using Spring MVC and have also tried setting the filter as below :

<bean id="filterInvocationInterceptor" class="org.springframework.security.intercept.web.FilterSecurityInterceptor">
<property name="securityMetadataSource">
<sec:filter-security-metadata-source>
<sec:intercept-url pattern="/*" access="IS_AUTHENTICATED_FULLY" />
<sec:intercept-url pattern="/login.jsp" access="IS_AUTHENTICATED_ANONYMOUSLY" />
<sec:intercept-url pattern="/**" access="ROLE_" />
</sec:filter-security-metadata-source>
</property>

Am I missing any basic stuff , please suggest what needs to be done ?

Thanks and Regards,
Chiku
reply
    Bookmark Topic Watch Topic
  • New Topic