Hi,

I have recently started working on Shiro.I want to use JndiLdapRealm for
authentication.

As I understand in general to access LDAP Server (Correct me if my
understanding of how LDAP authentication work. )

1) I need to have server url ldal://servern name: port
2) User's DN

When user login these will be used to connect with LDAP. If user exist into
LDAP it meas it is authenticated user. If user do not exist into LDAP then I
expect it throw User not found in this Realm.


But, instead of thowing exception JndiLdapRealm disply message that "USER is
authenticated" in log file.

My configurarion :  


  <bean id="lifecycleBeanPostProcessor"
class="org.apache.shiro.spring.LifecycleBeanPostProcessor" />

  <bean id="shiroFilter"
class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager" />
   
    <property name="loginUrl" value="/login.jsf" />
    <property name="successUrl" value="/welcome.jsf" />
    <property name="unauthorizedUrl" value="/unauthorized.jsf" />
    <property name="filterChainDefinitions">
      <value>
        /javax.faces.resource/** anon
        /resources/** anon
        /login.jsf anon
        /** = authc
      </value>
    </property>
  </bean>


  <bean id="securityManager"
class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <property name="realms">
      <list>
        <ref bean="localRealm" />
        <ref bean="ldapRealm" />
      </list>
    </property>
  </bean>

  <bean id="localRealm" class="com.web.security.LocalRealm" />

  <bean id="ldapRealm" class="org.apache.shiro.realm.ldap.JndiLdapRealm">
    <property name="contextFactory" ref="contextFactory" />
    <property name="userDnTemplate"
value="cn={0},ou=someusers,dc=somecompany,dc=com" />
  </bean>

  <bean id="contextFactory"
class="org.apache.shiro.realm.ldap.JndiLdapContextFactory">

    <property name="environment">
      <map>
        <entry key="java.naming.provider.url"
value="ldap://someladpserver:ldapport"; />
      </map>
    </property>

  </bean>
</beans>

--
View this message in context: 
http://shiro-user.582556.n2.nabble.com/Unable-to-authenticate-using-JndiLdapRealm-tp6369464p6369464.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply via email to