Free cookie consent management tool by TermsFeed Policy Generator

source: branches/UserManagement/HeuristicLab.Services.Authentication.ServiceClients/ClientFactory.cs @ 5142

Last change on this file since 5142 was 4962, checked in by mjesner, 14 years ago

#1196

File size: 756 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.ServiceModel;
6
7namespace HeuristicLab.Services.Authentication
8{
9    public class ClientFactory
10    {
11
12        public static T Create<T, I>()
13            where T : ClientBase<I>, I
14            where I : class
15        {
16            var client = Activator.CreateInstance<T>();
17            client.ClientCredentials.UserName.UserName = "Alice";
18            client.ClientCredentials.UserName.Password = "YouWillKnow";
19            client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None;
20
21            return client;
22
23        }
24
25    }
26
27}
28
Note: See TracBrowser for help on using the repository browser.