Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3237864
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:47:17+00:00 2026-05-17T17:47:17+00:00

I have problem with LDAP Spring Security, I’m trying to authorise against the LDAP

  • 0

I have problem with LDAP Spring Security, I’m trying to authorise against the LDAP server. I have the spring configuration xml file (security-config.xml) like this:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sec="http://www.springframework.org/schema/security"
 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
  http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">

 <bean id="contextSource" class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
  <constructor-arg value="ldap://111.111.111.111"/>
  <property name="userDn" value="cn=auth-user,ou=System,dc=foo,dc=com"/>
  <property name="password" value="fooPwd"/>
 </bean>

 <bean id="ldapAuthProvider" class="org.springframework.security.providers.ldap.LdapAuthenticationProvider">
  <constructor-arg>
   <bean class="org.springframework.security.providers.ldap.authenticator.BindAuthenticator">
    <constructor-arg ref="contextSource"/>
    <property name="userSearch">
     <bean id="userSearch" class="org.springframework.security.ldap.search.FilterBasedLdapUserSearch">
       <constructor-arg index="0" value="ou=people"/>
       <constructor-arg index="1" value="(uid={0})"/>
       <constructor-arg index="2" ref="contextSource" />
     </bean>
    </property>
   </bean>
  </constructor-arg>
  <constructor-arg>
   <bean class="com.company.name.services.UserAuthoritiesPopulator" />
  </constructor-arg>
 </bean>
</beans>

In the login controller (LoginController.java) I’m authorising like this:

@RequestMapping(value = "/login", method = RequestMethod.POST)
public String loginPPost(String username, String password, Model model, HttpServletRequest req, HttpServletResponse res) throws SQLException {

 UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(username, password);
 Authentication authentication = authenticationManager.authenticate(authRequest);
 SecurityContextHolder.getContext().setAuthentication(authentication);
 ...
}

The method “authenticationManager.authenticate(authRequest)” throws this exception:

org.springframework.security.providers.ProviderNotFoundException: No AuthenticationProvider found for org.springframework.security.providers.UsernamePasswordAuthenticationToken
    at org.springframework.security.providers.ProviderManager.doAuthentication(ProviderManager.java:214)
    at org.springframework.security.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:46)

Does anybody know how to solve this problem? Should I use different method for authorisation? Or is my configuration bad?

Thanks for any help,

Mateo

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:47:18+00:00Added an answer on May 17, 2026 at 5:47 pm

    You must add the tag ‘sec:custom-authentication-provider’ in your authentication provider bean:

    <bean id="ldapAuthProvider" class="org.springframework.security.providers.ldap.LdapAuthenticationProvider">
        <sec:custom-authentication-provider/>
        ...
    </bean>
    

    You can find an example that use Crowd instead of LDAP on my blog:
    http://aloiscochard.blogspot.com/2009/12/integrating-spring-security-with-ntlm_19.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have configured spring security with a ldap server (but continue reading, it's not
I have the following in my web.config <connectionStrings> <add name=ActiveDirectoryConnection connectionString=LDAP://ActiveDirectoryDomain1.com providerName=System.Web.Security.ActiveDirectoryMembershipProvider/> </connectionStrings> I
I have problem with TableView its empty. In (.h) file: @interface TableViewController : UITableViewController{
Good morning / afternoon, I have a problem with LDAP connector, when I use
I have a problem with manager attribute in Sun Directory Server. I set this
using python 2.6.5 and python-ldap 2.3.10, I have the following problem: Under certain circumstances
I am trying to make LDAP queries via Visual Basic. I don't have administrator
I have a problem. I created a web app and packaged it with Ldap
I have a custom LDAP schema installed on my OpenLDAP server which is as
Need your help with authenticating an active directory user ID against LDAP. My problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.