Can you move the provider building out of Spring into your AppModule so you
can actually specify a service id?

Or, as suggested by Chris, pass ApplicationContext into your
contributeProviderManager method instead of AuthenticationProvider, and
then do appContext.getBean("myBeanId") to get a specific provider to
contribute.

Or, you can get around it by having your AuthenticationProviders implement
different dummy interfaces that extend AuthenticationProvider.  Then, in
your contribute method, use your dummy interface instead of
AuthenticationProvider to avoid any confusion about which one you want.


On Mon, Nov 21, 2011 at 9:31 AM, Juan Alba <juan.a...@condortech.com.ar>wrote:

> Chris, thanks for the tip,
>
> What I am still missing is to assign more than one authenticationProvider
> to the  ProviderManager.
>
> I can see there that it is a List of providers, but I don't know how to set
> this list with all my different authenticationProviders.
>
> Does anybody knows?
>
>
> Thanks in advance!
>
> On Mon, Nov 21, 2011 at 5:20 AM, derkoe <
> tapestry.christian.koeb...@gmail.com> wrote:
>
> >
> > kado wrote
> > >
> > > Hi,
> > >
> > > I am trying to add a facebook provider to my app.
> > >
> > > I added the config to the xml and I had created the  Class
> > > FacebookDaoProvider just for testing if everything goes fine but when I
> > > start the server this message is shown:
> > >
> > > Construction of service ProviderManager failed: Error invoking service
> > > builder method
> > >
> >
> nu.localhost.tapestry5.springsecurity.services.SecurityModule.buildProviderManager(List)
> > > (at SecurityModule.java:333) (for service 'ProviderManager'): Error
> > > invoking service contribution method
> > >
> >
> ar.com.condor.services.CondorSecurityModule.contributeProviderManager(OrderedConfiguration,
> > > AuthenticationProvider): Spring context contains 2 beans assignable to
> > > type
> > > org.springframework.security.providers.AuthenticationProvider:
> > > daoAuthenticationProvider, facebookDaoProvider.
> > >
> > > Does anybody know what I am missing or what I am doing wrong?
> > >
> >
> > The problem is that you have 2 Spring beans binding the same type
> > (AuthenticationProvider) - Tapestry's injection is based on types, so it
> > cannot determine which service to inject.
> >
> > For a solution you can either eliminate one of the two Spring beans or
> > inject ApplicationContext and get the bean manually.
> >
> > --
> > Chris
> >
> > --
> > View this message in context:
> >
> http://tapestry.1045711.n5.nabble.com/Spring-security-can-t-add-AuthenticationProvider-tp5005539p5009797.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>



-- 
Jonathan Barker
ITStrategic

Reply via email to