Authentication with Service Bus for Windows Server 1.1 RRS feed

  • Question

  • Hi:

    I installed Service Bus for Windows server 1.1 on a windows server 2012 R2 which joined a windows domain.I built a application try to connect to that server from my windows 10 which not joined any windows domain.But I got a 401 exception.

    below is my code:

    string serverFqdn = "SB-160.moss.hnop.org"; int httpPort = 9355; int tcpPort = 9354; string serviceNamespace = "ServiceBusDefaultNamespace"; ServiceBusConnectionStringBuilder connBuilder = new ServiceBusConnectionStringBuilder(); connBuilder.ManagementPort = httpPort; connBuilder.RuntimePort = tcpPort; connBuilder.Endpoints.Add(new UriBuilder() { Scheme="sb",Host = serverFqdn,Path=serviceNamespace }.Uri); connBuilder.StsEndpoints.Add(new UriBuilder() { Scheme = "https", Host = serverFqdn, Path = serviceNamespace,Port=httpPort }.Uri); TokenProvider localUserTokenProvider = WindowsTokenProvider.CreateWindowsTokenProvider( connBuilder.StsEndpoints, new System.Net.NetworkCredential("adadmin", "abc@1234", "moss.hnop.org")); MessagingFactorySettings msgFactorySetting = new MessagingFactorySettings(); msgFactorySetting.TokenProvider = localUserTokenProvider; msgFactorySetting.OperationTimeout = new TimeSpan(50); NamespaceManagerSettings nmSetting = new NamespaceManagerSettings(); nmSetting.TokenProvider = localUserTokenProvider; MessagingFactory factory = MessagingFactory.Create( connBuilder.GetAbsoluteRuntimeEndpoints(),msgFactorySetting); NamespaceManager namespaceManager = new NamespaceManager( connBuilder.GetAbsoluteManagementEndpoints(), nmSetting); Console.WriteLine(namespaceManager.QueueExists("Test"));

    Console.WriteLine(namespaceManager.QueueExists("Test")); Console.ReadLine();

    can you help me ?thank you.


    Monday, January 4, 2016 2:26 AM

All replies

  • Hi,

    Thank you for reaching out to us.

    I am currently researching to gather more information with regards to your request. I shall revert back to you with an update at the earliest. Sincerely appreciate your patience.



    Monday, January 4, 2016 11:14 AM
  • In such cases (client not joined to any domain) the user used for authentication must be a local Windows user, with the same name and password on both computers. We use this solution too for authentication, because our hosting provider does not offer a Windows domain.
    • Proposed as answer by Tudor Turcu Friday, January 8, 2016 1:12 PM
    Friday, January 8, 2016 1:12 PM