Good day, 

I am trying to invoke a service using a WcfClient component . This request 
is using net.tcp  and the credentials for authentication should be provided 
for the service to be consumed. 

I followed this thread: 
https://groups.google.com/forum/#!searchin/castle-project-users/credentials$20WcfFacility/castle-project-users/00e42nVz67k/uVNmbhlKOtEJ
 
But even though I registered the AbstractChannelFactoryAware class to the 
container, I still get a "SecurityNegotiationException : The caller was not 
authenticated by the service. " 

Below is the class and the service resolving implementation:

public class UserNameClientCredentials : AbstractChannelFactoryAware
    {
        public string UserName { get; set; }

        public string Password { get; set; }

        public override void Created(ChannelFactory channelFactory)
        {
            channelFactory.Credentials.UserName.UserName = UserName;
            channelFactory.Credentials.UserName.Password = Password;
        }
    }

Instantiate: 
var credentials = new UserNameClientCredentials{ UserName = 
@"Domain\username", Password = "password"};

And then I try initiate the service

var container = new WindsorContainer().AddFacility<WcfFacility>();
container.Register(
Component.For<IMyservice>()
 .AsWcfClient(
DefaultClientModel.On(                    
WcfEndpoint.FromConfiguration("NetTcpBinding_IMyservice")
) 
),             
Component.For<IChannelFactoryAware>().Instance(credentials)
);

When I try to resolve my service: container.Resolve<IMyservice>() It throws 
a "The caller was not authenticated by the service. "

Please provide me some guidance on why the container is not using the 
authentication or if I'm missing something. 

Thank you very much in advance, 

Best regards

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/castle-project-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to