Have you found that even if you change the username and password on those
UserNameCredentials that the WcfFacility uses the new values? We're finding
that it only uses them once and caches them for the rest of the time.
On Friday, July 29, 2011 4:44:01 PM UTC+1, JeffG wrote:
>
> New day - new perspective.
>
> I got it with this..
>
> var binding = new
> BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
> binding.Security.Transport.ClientCredentialType =
> HttpClientCredentialType.Ntlm;
>
> Container = new WindsorContainer()
> .AddFacility<WcfFacility>
> .Register(Component.For<IService1>()
> .AsWcfClient(new DefaultClientModel(WcfEndpoint.BoundTo(binding)
> .At("http://localhost/service1.svc"))
> .Credentials(new UserNameCredentials("user1", "pass1"))))
> .Register(Component.For<IService2>()
> .AsWcfClient(new DefaultClientModel(WcfEndpoint.BoundTo(binding)
> .At("http://localhost/service2.svc"))
> .Credentials(new UserNameCredentials("user2", "pass2"))))
>
> On Jul 28, 6:15 pm, JeffG <[email protected]> wrote:
> > Using the following..
> >
> > Container = new WindsorContainer()
> > .AddFacility<WcfFacility>
> >
> .Register(Component.For<IService1>().AsWcfClient(WcfEndpoint.At("http://
> > localhost/service1.svc")))
> >
> .Register(Component.For<IService2>().AsWcfClient(WcfEndpoint.At("http://
> > localhost/service2.svc")));
> >
> > How do I set separate UserNameCredentials for each?
> >
> > On Jul 7, 10:42 am, Craig Neuwirt <[email protected]> wrote:
> >
> >
> >
> >
> >
> >
> >
> > > There is already a UserNameCredentials class in WcfFacility. You
> should be able to register an instance of that
> > > class in the container and update the UserName/Password when it is
> available. The facility should use that instance
> > > each time.
> >
> > > On Jul 6, 2011, at 10:00 AM, Nicolás Sabena wrote:
> >
> > > > Hi. I'm trying to use the WCFFacility to access a service.
> > > > With plain WCF, I used a MyServiceClient: ClientBase<IMyService>,
> > > > setting the username and password provided by the user:
> >
> > > > using (var service = new MyServiceClient())
> > > > {
> > > > service.ClientCredentials.UserName.UserName = username;
> > > > service.ClientCredentials.UserName.Password = password;
> > > > service.Authenticate();
> > > > }
> >
> > > > I read about doing this with a IChannelFactoryAware implementation,
> > > > using the Created() notification.
> >
> > > > Problem is: I don't know the username and password when registering
> > > > components in the container. The authentication data is entered by
> the
> > > > user, and with this data I have to call (once) this service (I
> should
> > > > "remember" the username and password, this is to be called only once
> > > > after login).
> >
> > > > How should I set the username and password at runtime, just for this
> > > > service, after the user provides the information?
> >
> > > > --
> > > > You received this message because you are subscribed to the Google
> Groups "Castle Project Users" group.
> > > > To post to this group, send email to
> > > > [email protected]<javascript:>.
>
> > > > To unsubscribe from this group, send email to
> [email protected] <javascript:>.
> > > > For more options, visit this group athttp://
> groups.google.com/group/castle-project-users?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/castle-project-users/-/c9V8HpC14T4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.