Announcement Announcement Module
Collapse
No announcement yet.
SpringSecurity 3.0.5 - LDAP Login Failure Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SpringSecurity 3.0.5 - LDAP Login Failure

    Hi,

    I am using spring security 3.0.5 jars and LDAP.

    When ever I try to login to my application it always fails for the first time, but allows from the next onwards.

    Please if any one could help me wit h this ?

    Is it a regular behavior or is it that I am doing something wrong ?

    Below is spring-security.xml my project is running with :

    --------------------------------------------------------- XML File -----------------------------------------------------------------------------------


    <beans:beans xmlns="http://www.springframework.org/schema/security"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schem...-beans-3.0.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security-3.0.3.xsd">

    <beans:bean class="org.springframework.security.web.access.exp ression.DefaultWebSecurityExpressionHandler"></beans:bean>


    <http auto-config="true" use-expressions="true" access-denied-page="/login/accessDenied">
    <intercept-url pattern="/login/**" access="permitAll"/>
    <intercept-url pattern="/opportunity/**" access="hasRole('ROLE_GUEST') or hasRole('ROLE_SUPER_USER') or hasRole('ROLE_APPROVER')"/>
    <intercept-url pattern="/solution/**" access="hasRole('ROLE_GUEST') or hasRole('ROLE_SUPER_USER') or hasRole('ROLE_SOLUTION_MANAGER') or hasRole('ROLE_APPROVER')"/>
    <intercept-url pattern="/action/**" access="hasRole('ROLE_SUPER_USER') or hasRole('ROLE_SOLUTION_MANAGER') or hasRole('ROLE_APPROVER')"/>
    <intercept-url pattern="/admin/**" access="hasRole('ROLE_SUPER_USER')"/>


    <form-login login-page="/login/homePage" default-target-url="/login/verifyUser"
    always-use-default-target="true" authentication-failure-url="/login/homePage?flag=false"></form-login>

    <session-management invalid-session-url="/login/homePage?expire=true">
    <concurrency-control max-sessions="3" error-if-maximum-exceeded="true" />
    </session-management>

    <logout logout-url="/login/logout"
    invalidate-session="true"
    logout-success-url="/login/homePage" />
    </http>

    <beans:bean id="contextSource" class="org.springframework.security.ldap.DefaultSp ringSecurityContextSource">
    <beans:constructor-arg value="ldap://abc.xxxxxxx.xy:389/" />
    <beansroperty name="userDn" value="uid=xxxxx,ou=users,ou=internal,o=xxxxxxx" />
    <beansroperty name="password" value="xxxxxxx" />
    </beans:bean>

    <beans:bean id="ldapAuthProvider"
    class="org.springframework.security.ldap.authentic ation.LdapAuthenticationProvider">
    <beans:constructor-arg>
    <beans:bean class="org.springframework.security.ldap.authentic ation.BindAuthenticator">
    <beans:constructor-arg ref="contextSource"/>
    <beansroperty name="userDnPatterns">
    <beans:list><beans:value>uid={0},ou=users,ou=inter nal,o=xxxxx</beans:value></beans:list>
    </beansroperty>
    </beans:bean>
    </beans:constructor-arg>
    </beans:bean>

    <authentication-manager>
    <ldap-authentication-provider user-search-filter="(uid={0})" user-search-base="ou=users,ou=internal,o=xxxxx"/>
    </authentication-manager>

    </beans:beans>


    --------------------------------------- End -----------------------------------------------------------------------------------------------------------------



    Thanks
    vishal
    Last edited by singwallvishal; Mar 20th, 2013, 01:15 AM.
Working...
X