LDAP authentication without managerDN and manager password

非 Y 不嫁゛ 提交于 2019-12-04 05:05:27

问题


I am writing an application in Java Spring framework to perform Active Directory LDAP authentication. I am succeeding in connecting to my organization LDAP.

Here is the configuration settings:Spring-security.xml

<!-- This is where we configure Spring-Security -->
<security:http auto-config="true" use-expressions="true"
    access-denied-page="/oops">

    <security:intercept-url pattern="/auth/*"
        access="isAuthenticated()" />


    <security:logout invalidate-session="true"
        logout-success-url="/" logout-url="/logout" />

</security:http>

<security:authentication-manager>
    <security:ldap-authentication-provider
        user-search-filter="(&amp;(sAMAccountname={0})(objectCategory=user))"
        user-search-base="DC=am, DC=example, DC=com" group-search-filter="(&amp;(sAMAccountname={0})(objectCategory=group))"
        group-search-base="DC=am, DC=example, DC=com">
    </security:ldap-authentication-provider>
</security:authentication-manager>




<security:ldap-server url="ldaps://myserver.am.example.com:4567"
manager-dn="CN=Johnson \, Mitchell, OU=San Francisco,DC=am,DC=example,DC=com"
manager-password="sdvsdvsvs" />

My question here is that,is there any way to authenticate LDAP without supplying manager-dn and manager-password in security:ldap-server tag. Please provide a solution to this.Thanks in advance.


回答1:


Define an administrative user who has the necessary permissions, and use that. You certainly shouldn't use the managerDN for anything in your application.



来源:https://stackoverflow.com/questions/26472734/ldap-authentication-without-managerdn-and-manager-password

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!