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 654935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:32:53+00:00 2026-05-13T22:32:53+00:00

I am trying to programatically validate a user login/pass using Spring Security, so I

  • 0

I am trying to programatically validate a user login/pass using Spring Security, so I need to have access to the ProviderManager. I would like it to be automatically injected into my @Controller.

My code looks like:

import org.springframework.security.authentication.ProviderManager;

// ...

@Controller
public class MyController {

    @Autowired
    private ProviderManager authenticationManager;

But when I try to run the application I get this error message:

No unique bean of type [org.springframework.security.authentication.ProviderManager] is defined: 
expected single matching bean but found 2: 
[org.springframework.security.authentication.ProviderManager#0, org.springframework.security.authenticationManager]

What could be the cause or how could I solve it?

I am using Spring Security 3.0.0-RC1 with Spring 3.0.1, and I’ve not defined any ProviderManager bean. I’ve successfully used:

@Resource
private ProviderManager authenticationManager;

in other projects, but javax.annotation.Resource is not supported in GAE.

  • 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-13T22:32:54+00:00Added an answer on May 13, 2026 at 10:32 pm

    There are two AuthenticationManagers in the context:

    • org.springframework.security.authenticationManager is populated with authentication providers explicitly declared in <authentication-manager>
    • org.springframework.security.authentication.ProviderManager#0 is populated with implicitly declared providers (remember me, anonymous and so on) and delegates the authentication request to org.springframework.security.authenticationManager as a fallback.

    So, I guess you need

    @Autowired @Qualifier("org.springframework.security.authenticationManager")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to programatically unzip a zipped file. I have tried using the
I'm trying to populate a ComboBox programatically. I am creating ComboBoxItems and would like
I'm trying to access a relationship (one to many) programatically. My Data model contains
I'm trying to programatically create a new Active Directory user setting the sAMAccountName attribute
So I'm trying to add UIImageViews programatically (in this case I don't have the
im trying to programatically do a UITabBarController using a UINavigationController inside each UIViewController called
I am trying to programatically add items to a ListView in WPF. I have
I am trying to programatically generate movie/video file using Google Earth COM APIs (along
I'm trying to convert programatically PDF to HTML. So far I've been using pdftohtml
I'm trying to programatically create a SharePoint site from a custom template using ASPX

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.