Announcement Announcement Module
Collapse
No announcement yet.
Acegi Authentication not getting fired Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Acegi Authentication not getting fired

    Hi
    I am a sample application with ACEGI security frame work. I have configured all the needed stuffs.
    applicationcontext.xml
    <bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy">
    <property name="filterInvocationDefinitionSource">
    <value>
    CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
    PATTERN_TYPE_APACHE_ANT
    /**=httpSessionContextIntegrationFilter,authenticat ionProcessingFilter
    </value>
    </property>
    </bean>
    <bean id="httpSessionContextIntegrationFilter" class="org.acegisecurity.context.HttpSessionContex tIntegrationFilter"/>

    <bean id="authenticationProcessingFilter" class="org.acegisecurity.ui.webapp.AuthenticationP rocessingFilter">
    <property name="authenticationManager" ref="authenticationManager"/>
    <property name="authenticationFailureUrl" value="/jsp/login.jsp"/>
    <property name="defaultTargetUrl" value="/"/>
    <property name="filterProcessesUrl" value="/j_acegi_security_check"/>
    </bean>
    <bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager ">
    <property name="providers">
    <list>
    <ref local="daoAuthenticationProvider"/>
    </list>
    </property>
    <!--<property name="sessionController">
    <ref bean="concurrentSessionController"/>
    </property> -->
    </bean>

    <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenti cationProvider">
    <property name="userDetailsService" ref="userDetailsService"/>
    </bean>

    <bean id="userDetailsService" class="org.acegisecurity.userdetails.memory.InMemo ryDaoImpl">
    <property name="userProperties">
    <bean class="org.springframework.beans.factory.config.Pr opertiesFactoryBean">
    <property name="location" value="/WEB-INF/users.properties"/>
    </bean>
    </property>
    </bean>

    my login page is
    <jsp:root version="1.2" xmlns:jsp="http://java.sun.com/JSP/Page"xmlns:c="urn:jsptld:http://java.sun.com/jsp/jstl/core">
    <jsp:directive.page contentType="text/html; charset=UTF-8" />
    <jsp:directive.page import="org.acegisecurity.ui.AbstractProcessingFil ter, org.acegisecurity.ui.webapp.AuthenticationProcessi ngFilter, org.acegisecurity.AuthenticationException" />
    <head>

    <title>Gateway Deployment Tool</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <link href="../css/style-firefox.css" rel="stylesheet"/>
    <!--[if gte IE 6]>
    <link href="../css/style.css" rel="stylesheet"/>
    <![endif] -->
    </head>
    <script>
    funciton loginSubmit()
    {
    alert(" Login submit ");

    }
    function loginReset()
    {
    alert(" Login Reset ");
    }
    </script>
    <form action="j_acegi_security_check" method="post">
    <body class="design">
    <table >
    <tr>
    <td>
    <table id="loginPage" style="background: url(../img/login_bg.gif) top right repeat-x; ">
    <tr>
    <td class="tbl_bcgLogin" align="left">
    UserName:
    <FONT SIZE=3 COLOR="red" FACE="Arial">&nbsp;*&nbsp;</FONT>
    <img src="../img/user.GIF"/>&nbsp;
    </td>
    <td class="tbl_bcgLogin" align="right">
    <input class="contentTextBoxNormal" type="text" name="j_username" id="j_username" value="$!status.value" tabindex="1" />
    </td>
    </tr>
    <tr>
    <td class="tbl_bcgLogin" align="left">
    Password:
    <FONT SIZE=3 COLOR="red" FACE="Arial">&nbsp;*&nbsp;</FONT>
    <img src="../img/pwd.GIF"/>&nbsp;
    </td>
    <td class="tbl_bcgLogin" align="right">
    <input class="contentTextBoxNormal" type="password" name="j_password" id="j_password" tabindex="1" value="$!status.value" onkeypress="submitonEnter(event)"/>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td>
    <table>
    <tr>
    <td class="bttn" style="width:15px;border:0px;height:23px"><a id="loginLink" tabindex="1" onClick="loginSubmit()"><img src="../img/btn_login.gif" name="btnLogin" id="btnLogin"/></a></td>&nbsp;
    <td class="bttn" style="width:15px;border:0px;height:23px"><a id="resetLink" tabindex="1" onClick="loginReset()" ><img src="../img/btn_reset.gif" name="btnreset" id="btnReset"/></a></td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </body>
    </form>
    </jsp:root>

    After doing this when i invoke other urls authenticationProcessingFilter is not getting fired
    Please help me to sort out the mistake i have done in configuration

    I have seperate property file which hold username and password details as
    users.properties

    shankar=nathan,ROLE_USER
Working...
X