Results 1 to 2 of 2

Thread: WCF, can I just confirm something

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Posts
    262

    WCF, can I just confirm something

    Hi All,

    I have the below code for my service, could I just confirm my own understanding that the client will connect establish a secure connection using the certificate specified in the below code. It will then pass a username and password to authenticate itself. I only ask as, well I only ask as I've been trying so many differet binding combinations that I've got myself in a complete tiswas.

    Cheers


    Code:
       Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim tcpbinding As New NetTcpBinding()
            tcpbinding.Security.Mode = SecurityMode.Message
            ' tcpbinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Certificate
            tcpbinding.Security.Message.ClientCredentialType = MessageCredentialType.UserName
            Dim tcpuri As New Uri("net.tcp://kalel:5051/mns")
    
            Dim host As New ServiceHost(GetType(MagicNumbers), tcpuri)
            host.Credentials.ServiceCertificate.SetCertificate(System.Security.Cryptography.X509Certificates.StoreLocation.CurrentUser, System.Security.Cryptography.X509Certificates.StoreName.Root, System.Security.Cryptography.X509Certificates.X509FindType.FindByThumbprint, "e0 0f 82 a6 c4 06 2d 2e 7c 55 80 0f 51 a6 c5 e9 f1 15 93 9f")
            host.Credentials.IssuedTokenAuthentication.RevocationMode = System.Security.Cryptography.X509Certificates.X509RevocationMode.NoCheck
    
    
            Dim smb As New Description.ServiceMetadataBehavior
    
            host.Description.Behaviors.Add(smb)
    
    
    
            host.AddServiceEndpoint(GetType(MagicNumbers), tcpbinding, "net.tcp://kalel:5051/mns")
    
    
            host.AddServiceEndpoint(GetType(Description.IMetadataExchange), System.ServiceModel.Description.MetadataExchangeBindings.CreateMexTcpBinding(), "mex")
            host.Open()
    
    
            MessageBox.Show("Service Started!")
        End Sub

  2. #2
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611

    Re: WCF, can I just confirm something

    The clients needs to have a certificate the is of the same ROOTcertificate as the certificate with thumprint "e0 0f 82 a6 c4 06 2d 2e 7c 55 80 0f 51 a6 c5 e9 f1 15 93 9f"
    And indeed is a username/password involved for authentication, but i don't see a methode that handles the username/password.
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width